I need to load a BMP into C++ and code a program to convert it into a JPEG. I have very little programming experience and am wondering what libraries should be used to efficiently convert an image in this way.

Is there a library that will convert the BMP straight to a JPEG? Or is it the case that the file will need to be loaded in and the data displayed in an array from which the calculations on that array will take place?

Any help is greatly appreciated.

7 Years
Discussion Span
Last Post by palanethra.ag

If you have a sufficient version of microsoft visual studio
you might be able to use the CImage class


however, express doesn't have this.

Otherwise it is a messy procedure as there is more than one jpeg encoding you probably will need to read up on bitmap headers or find someone's sample code.


First of all, the BMP fileformat, is quite simple to handle and load, check it out, it's all uncompressed, and it basically:

Header (all the info stuff)

The JPG is a lot worse, I would use DevIL to compress and convert your BMP :)


Hi all. i nee d to convert .jpeg file to .bmp or grascale image using C code. can anyone help me out.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.