Forum Moderators: not2easy

Message Too Old, No Replies

What is the difference of all the formats

....for images

         

kodaks

8:17 pm on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am relatively new graphics, so I apoligize if this is a DUH! question. What is the difference between the image formats (like .jpg, .gif, etc.)? The most important thing I need to know, is what will make the image the best looking. Thanks in advance!

Shannon Moore

8:49 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



Others will provide more in-depth responses, I'm sure, but the quickie answer is:

* 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]

kodaks

8:56 pm on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks!

Shannon Moore

9:35 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



Glad to help. Like I said, I hope others reply as well. My focus and experience with graphics file formats is heavily geared to photographic images. Someone who's a graphics artist will have more information from that angle.

You'll be in good stead just knowing the best uses for GIF and JPEG, however. That'll cover your basic website maintenance issues.

JayCee

6:34 am on Sep 6, 2004 (gmt 0)

10+ Year Member



Good advice from Shannon.

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.

limbo

12:05 pm on Sep 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Definitions might help a bit more:

JPEG [google.com]
GIF [google.com]
PNG [google.com]
Bitmap [google.com]

Farix

1:58 pm on Sep 6, 2004 (gmt 0)

10+ Year Member



But some browers don't seem to render .png files very well yet.

False. Almost all modern browsers--4 years or newer--are able to handle most PNG features. The only thing that you really need to concern yourself with is IE's lack of native support for 8-bit alpha-channel transparency, though 1-bit color replacement transparency is fully supported and you can get alpha-channel transparency to work in IE 5.5+ via JavaScript and a proprietary filter.

Robin_reala

2:39 pm on Sep 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are some gamma issues with IE as well, but you're not going to come across them with everyday use. I tend to stick to PNGs for everything apart from big photos, but I suspect that PNG/GIF is personal choice for the majority of cases. I find PNGs tend to be smaller if you use a program like PNGCrush, and they're more flexible overall.

limbo

2:53 pm on Sep 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



and they're more flexible overall.

Too true - It's nice to able to edit text, vector elements and layers without the need for a parent file - as you would with GIF's and JPEG's.

JayCee

3:18 pm on Sep 6, 2004 (gmt 0)

10+ Year Member



If i can't use 24 bit .png in MSIE 6.0 (mine show transparent areas as opaque blue), unless i use a special script, filter or other hack, then why is my statement that "some browsers don't seem to render .png very well" false?

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."

stef25

9:49 am on Sep 7, 2004 (gmt 0)

10+ Year Member



perhaps slightly off topic, but if a jpg is re-saved at 100% (ie no additional compression) the quality will not diminish right?

py9jmas

10:02 am on Sep 7, 2004 (gmt 0)

10+ Year Member



Wrong.

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.