Convert buffer to jpeg

I am trying to convert a buffer to JPEG in memory, and would like to implement something similar to the Pylon function PylonImageFormatConverterConvert
This function takes the buffer and pixel format as inputs and then converts it to the pixel format expected by the libjpeg library. I have tried using the libraw, but it doesn’t recognize all of the possible pixel formats used in the genicom standard. So far, I have only had success when I ensure that the camera is using a specific pixel format.

Thanks

Hi,

It looks like a good candidate to do pixel format conversion is openCV.

https://docs.opencv.org/4.9.0/d8/d01/group__imgproc__color__conversions.html

Emmanuel.

Thanks Emmanuel, I’ll take a look at it.