View Full Version : JPEG questions
05-15-2002, 12:15 AM
1) I understand that JPEG supports RGBA formats (it even supports up to 255 components). On the other hand I have never seen a JPEG image with an alpha channel. Are there any programs that export RGBA JPEG images?
2) Is there a more compact JPEG library than the official libjpeg v6 from the Independent JPEG Group. I only need loading, and no fancy stuff (no rescaling, palettizing etc). It should also be portable (e.g. Intels JPEG library won't do)
05-15-2002, 03:46 PM
JPEG is not encoded in a fashion that would make an alpha channel feasible or effective.
I recommend you stick with TGA if you like keeping alpha information with the image.
05-15-2002, 11:55 PM
Yes, I know the lossy nature of JPEG (especially how it hurts sharp edges and areas of constant intensity, which is often important for the alpha channel).
However, I'm looking into the possibility to add (optional) JPEG support to the texture and image loading capabilities of GLFW. Currently only the TGA format is supported (and it's supported very well).
I too prefer the TGA file format (or PNG when I can afford the size/overhead of the PNG library).
Anyway, I have still not found any answers to my original questions...
05-16-2002, 11:20 AM
perhaps you should look for DevIl http://www.imagelib.org It is free and cross platform and easy to use with dozens of supported file formats.It also has a natural interface to DirectX, OpenGL and Allegro
05-16-2002, 01:45 PM
if all else fails you might want to dump the alpha channel into a separate file (RAW format for example) and then assemble the image data from the jpeg and the RAW in your program which should be easy.
although that's not as efficient as an RGBA jpeg might be it's still better than a huge tga.
05-17-2002, 06:25 AM
If you set the quality of JPEG to 100, then you wont notice anything and the compression will still be excellent.
I have used intel's lib for this, but never actually used the image as a texture, (only for screenshot)
For textures, it is recommended to use lossless compression anyway ......
PS: why do you care about hard disk space?
05-17-2002, 09:08 AM
100% quality compresses lossless? hmmm i doubt that, there's always a special case that proves assumptions wrong http://www.opengl.org/discussion_boards/ubb/smile.gif
probably he cares about HD space because he wants to put the thing on the web and wants small filesize.
05-17-2002, 04:51 PM
Even if you did do 0 compression, you would still be putting a square peg in a round hole.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.