PDA

View Full Version : JPEG



Bra'Tac
04-04-2001, 11:26 PM
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 ???

Hairybudda
04-05-2001, 01:26 AM
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. http://www.opengl.org/discussion_boards/ubb/smile.gif Sorry...

lpVoid
04-05-2001, 04:01 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

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

DFrey
04-05-2001, 09:20 AM
Another option is to use the Independent JPEG Group's (http://www.ijg.org) 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).

FoxDie
04-05-2001, 10:25 AM
Go to www.s3.com (http://www.s3.com) and look for
their image compression.It's
very good compression.It save
about 75%.

04-05-2001, 11:47 PM
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/

pgup
04-07-2001, 11:10 PM
Originally posted by DFrey:
Another option is to use the Independent JPEG Group's (http://www.ijg.org) 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

04-08-2001, 04:09 AM
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 :-)

DFrey
04-08-2001, 07:42 AM
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).]

pgup
04-10-2001, 06:23 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif
thanks for the help, guys!
pgup

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