CImg icon indicating copy to clipboard operation
CImg copied to clipboard

[Question] PNG from buffer

Open emanueleci opened this issue 4 years ago • 0 comments

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

emanueleci avatar Oct 14 '21 20:10 emanueleci