GreycLab / CImg

The CImg Library is a small and open-source C++ toolkit for image processing
http://cimg.eu
Other
1.48k stars 282 forks source link

[Question] PNG from buffer #331

Open emanueleci opened 2 years ago

emanueleci commented 2 years ago

Hi, i'm trying to construct a Cimg image from a std::vector filled by a lodepng decoded buffer in C++. .... std::vector imag; std::vector vectorBuffer(chunk.myBuffer, chunk.myBuffer + chunk.size); //my CURL buffer with PNG compressed image unsigned error = lodepng::decode(imag, width, height, vectorBuffer); ..... so imag contains decoded PNG image, 4 bytes per pixel, ordered RGBARGBA and i'm trying to understand how to create a CImg image.

With Jpeg o can use jpeg_buffer plugin to create a Cimg image from a Jpeg compressed buffer, but i don't know how to do it with PNG.

Thank you for any suggestion Emanuele