how to read jpg or bmp graphics file format in C++?

Feb 16, 2008 at 3:50pm
Hi, Im having this project in our CS that needs to read either jpg or bmp graphics file format so that we can process it.

Actually we are going to make a face recognition program using neural network. So inorder to do so, we need to read the pictures of the faces to be recognize either in jpg or bmp.

I was able to use MATLAB in one of my programming class and tried reading jpg graphics file format. MATLAB represented the graphics file format as a multidimensional array whose array dimensions are dependent on the graphics file resolution. Is their a C++ library that is designed to do he same task? Which one?

Thank you in advance guys! :)
Feb 17, 2008 at 3:29am
JPEG is not so simple, and requires several libraries. Your best bet here is to look for code on the internet. A nice little lib is found here:

http://www.voicenet.com/~richgel/

BMP is a very simple format. As a twist, it isn't so easy to find good code examples on the internet for reading BMP, but you can easily write your own reader for it. If you're really lost, I can give you a simple BMP reader I wrote. (If you go to the pygame cookbook site there is a Load 32-bit BMP with Alpha reader I wrote which has the essential details...)

Hope this helps.
Last edited on Feb 17, 2008 at 5:34pm
Feb 17, 2008 at 1:53pm
Thanks :) I will try what you said :) I keep you posted as to the developments of my program :)
Feb 22, 2008 at 10:43am
The first in my mind is ImageMagick : http://www.imagemagick.org/Magick++/
You can use it as a command line soft, or include it in your project (linking against it).

But you can find some others on the web.
Feb 24, 2008 at 6:55pm
Thank you Sir Marmotton :)

I will try it :)
Topic archived. No new replies allowed.