JPEG

hello, i want to use jpeg instead of bmp for my textures because the size of my exe have to be little. Have you got some links or some ideas ???

The fact that you are loading BMP file changes nothing about the exe file. The only thing that changes is the amount of physical memory you need to run the prog, and the disc space.
Memory is needed more when using JPEG’s, because they need to be decompressed into memory, and then loaded as a texture, so there’s no point. Sorry…

I think the issue here is transport size not executable image size, so jpgs are a damn good option IMHO. While all images end up taking a (mostly) fixed amount of video memory based on size and pixel format, jpegs are a hell of a lot easier to move around…expecially when you live on the side of town that still dosen’t have cable modem or DSL access

First thing I would recommend is checking out the intel jpeg library at http://developer.intel.com/software/products/perflib/ijl/ijldown.htm . It’s really easy to use and has decent documentation. The only issue you are going to have to deal with is the fact that it requires it’s own dll, so you’ll have to distribute that along with you app. It’s only ~350k, so if you’re sending more than one image, you’ll make up for the loss.

Personally, I think the ijl is a bit too bloated for production use, but it’s great for demos and protos.

Hope this helped,
Dave

Another option is to use the Independent JPEG Group’s library. It is statically linked and is only about 150K (which you could reduce even further if you just want to unencode jpegs and have no need to encode jpegs).

Go to www.s3.com and look for
their image compression.It’s
very good compression.It save
about 75%.

The SDL_image lib for SDL offers a dirt simple interface for decrypting many transport formats into OpenGL-friendly bitmaps.

SDL_image does depend on the ijg library for its jpeg decompression.
http://www.devolution.com/~slouken/SDL/

Originally posted by DFrey:
Another option is to use the Independent JPEG Group’s library. It is statically linked and is only about 150K (which you could reduce even further if you just want to unencode jpegs and have no need to encode jpegs).

Hello
Do you know where I can find information about how to reduce the library’s size? I’d only need it’s unencode abilities. How could I achieve that?
Thanks
pgup

I haved your same problem but I have find some very good material here :
http://www.programmersheaven.com/zone10/cat453/index.htm

I have transform the JPEG-GIF decoder in a JPEG-RGBA decoder and it is quite small…
Also you can find here a jpegd.lib

Bye :slight_smile:

Actually, after thinking about it, since that library is statically linked, the linker should automatically remove the unused functions by default. So if you really want to make it much smaller, you’d have to go through the unencode source tree and see what you can do to reduce the size of those functions.

[This message has been edited by DFrey (edited 04-08-2001).]

Originally posted by DFrey:
Actually, after thinking about it, since that library is statically linked, the linker should automatically remove the unused functions by default. […]

indeed. it only adds about 70kb to the exe. upx it and be happy
thanks for the help, guys!
pgup

[This message has been edited by pgup (edited 04-10-2001).]