C ++ image image pixels

I want C ++ code to read every pixel from an image file. and i want to save pixels as: p [] g [] b []

Does anyone know how to do this?

+2


a source to share


4 answers


The answer depends on the format of the image file. Is it a format that contains raw RGB data (like uncompressed TGA )? Is this a YUV image? Is it a compressed image like JPEG or PNG?



There are already many C ++ libraries that can read a large number of image file formats and then provide the required pixel level access. Take a look at Adobe GIL or CImg for example.

+2


a source


There are many freely available libraries for reading various image file formats. Since you are using C ++ you might look at Adobe 's Universal Image Library (GIL) or even OpenCV .



+1


a source


This will help you figure it out, very easy to use and "low level" image library: http://easybmp.sourceforge.net/

+1


a source


Two libraries I've used that jump to my head:

These libraries can handle a wide variety of image formats depending on what you need.

0


a source







All Articles