CSCI 1710
Image Terms and Types


Reading: Niederst -- Chapter 13 and pages 229-233


Some Graphics Terms

The following are a few of the terms that you might hear when web designers discuss graphics. There is a much better description in your textbook, but I wanted to provide a summary here.

Comparison between GIF, JPEG, and PNG

The textbook describes the three types of images that are permitted for incorporation into web pages. The table below compares them. (There are two types of GIF images making for four columns.)

Comparison Chart:

 

GIF87a

GIF89a

JPEG

PNG

Colors supported

256 colors (indexed)

256 colors (indexed)

24-bit color

8-bit color, 16-bit grayscale, and 48-bit truecolor

Compression

Lossless (except in conversion to 256 colors)

Lossless (except in conversion to 256 colors)

Lossy (irretrievable loss of information when storing; user has control of compression rate)

Lossless
Slightly better than GIF (5-25% smaller)

Suited for:

Solid colors or no gradations

Solid colors or no gradations

Lots of colors, photographs; should never be used where losses are not permitted

Solid colors or no gradations; photographs where loss is unacceptable

Transparency

No

Yes

No

 

Animation

No

Yes

No

 

Interlacing

Yes

Yes

JPEG - no

Progressive JPEG - Yes

In both x and y axis. Also displays first image after 1/64th of file is downloaded.

Comment blocks

No

Yes

No

Yes

Other

Patent fee for incorporating into software product

Patent fee for incorporating into software product

Takes longer to uncompress than GIF or PNG.

No patent fee; open license. Still not widely supported

The following links are to additional sites comparing the image formats discussed here.

Lossy Versus Lossless Compression

First, let's take a look at lossy compression. Lossy compression uses an algorithms to convert an image into a smaller amount of data. As a result, some of the finer details of the image are lost. The problem is that they are lost forever. Once you save an image as a JPEG, you will never be able to return to the quality of the original image. In addition, if you edit a JPEG image and save it, then edit it and save it again, each of the subsequent saves results in more information lost.

The table below shows what happens when the same image is stored over and over again using the JPEG format. Examining each image shows that with subsequent saves, noise enters the image resulting in a halo of distortion and some discoloring.

1st save 2nd save 3rd save 4th save 5th save

Lossless compression does not lose its quality with multiple saves. GIF's compression, however, does force a different type of image degradation. It restricts the number of colors the image can contain. For example, GIF doesn't display gradual gradients of color well as compared with JPEG.

File saved as JPEG
1,879 bytes
File saved as GIF
2,100 bytes

JPEG on the other hand, doesn't handle solid-colored shapes as well as GIF.

-- GIF (2,166 bytes)

-- JPEG (4,577 bytes)

GIF89a, one of the later standards defining the format, has some additional features over JPEG.


GIF89a utilizing both transparency and animation

Other Techniques to Reduce Image Size