Forum Moderators: not2easy
* GIF images are best for line art, text and non-photographic images (icons, simple logos, that sort of thing). A GIF can only have a maximum of 256 colors. You cannot compress GIFs the way you can JPEGs, although you can save them with fewer colors -- use only as many colors as you need (such as 16 colors for an icon, instead of the full 256 colors).
* JPEG (JPG) images are best for photographic images and complex graphics (fractals, artist renderings, etc.) JPEGs can store up to 65k colors (16 bit JPEG) or up to 16 million colors (24 bit JPEG), and can be compressed. This compression can result in smaller file sizes with minimal image/visual degredation. However, JPEG is what's called a "lossy" format meaning the more you compress a JPEG the more image data you lose. You can tell when an image has been excessively compressed because it starts to get very blurry, especially along hard lines and sharp contrasts in color in the image. Individual pixels/blocks of color start to stand out.
Here's some info you might find useful -- it's to the Google search results for the search: difference jpeg gif [google.com]
Other image formats you might want to learn about are: PNG and TIFF, though there are many others (alphabet soup, anyone?)
[edited by: Shannon_Moore at 8:57 pm (utc) on Sep. 3, 2004]
You'll be in good stead just knowing the best uses for GIF and JPEG, however. That'll cover your basic website maintenance issues.
For photos (and where brightness/hue/saturation change continously, use .jpg for the web and .tif for passing large image files losslessly to others. For web signs, cartoon-like drawings, etc., use .gif.
Think of the difference between a photo and a cartoon or a map. A map/cartoon has defined separate areas, each with it's own hue/brightness/saturation. A photo has smooth blends, not separate areas.
What you need to understand about .jpg compression is that you can only do it ONCE (or twice, if the first one is a large file compressed in a digital camera - and you have no choice).
You see, each time you compress a .jpg image file (or convert another file to .jpg and then compress it), you are doing some damage to the image. The idea is that the file ends up much smaller in size and the damage is not bad enough to spoil the image. But if you try to compress that same image again, the damage will be much worse and usually very visible. In Photoshop .jpg compression of 40% to 70% is usally possible without loosing too much image quality.
The rule is to always do the .jpg compression as the last step in your image "work-flow" and to always save an uncompressed version, so you can work with that image again - without compressing it twice. You should also know that some .jpg compressors are better than others.
A newer image format is .png, which is supposed to have the best of .gif and .jpg - that is, it can have transparent areas, like a .gif, and continous tones, like a .jpg. But some browers don't seem to render .png files very well yet.
But some browers don't seem to render .png files very well yet.
If there is no problem, why are such hacks necessary?
Does not make sense to me that to say, essentially, "there is no problem, just this problem."
man cjpeg:
quality 100 will generate a quantization table of all 1's, minimizing loss in the quantization step (but there is still information loss in subsampling, as well as roundoff error). This setting is mainly of interest for experimental purposes. Quality values above about 95 are not recommended for normal use; the compressed file size goes up dramatically for hardly any gain in output image quality.