jpeg images - urgent

I need to read jpeg images as 3D arrays … could anyone tell my what is the best possible way to do it. i already have code in C for processing the 3D array… i have been using .img format uptil now which is the simplest way to store images.

Thanks for ur advice.

What do you mean by ‘as 3D array’? Multiple 2D images that form volumetric data? Using a single image as a heightmap?

Anyway, as for reading jpeg :

1/the reference library is libjpeg, found at http://www.ijg.org .It’s object-oriented C code (function pointers everywhere). Fast and portable. Maybe messy if you are not used to this kind of code.

2/many image libraries provide higher level functions to load jpeg. One example is DevIL, which can be found at http://www.imagelib.org . It uses libjpeg internally, but exposes simple means to load jpeg files. It has OpenGL-style syntax, and also a C++ wrapper.

Also try glBMP , which facilitate reading/writing jpeg, BMP, PNG, GIF as glTextures (with transparency where applicable), and does screen shots.