previous next
 

Image Optimization

Getting the most from your graphic images can make your web content effective and efficient. Although Internet access is speeding up and graphics are becoming richer, it is still important to optimize an image to the smallest possible size without affecting how the image looks.

Optimization techniques are different for each bitmap format. GIF files can be optimized by removing colors from the image color palette. JPG can be optimized by lessening the quality of the image.

GIF Optimization
The best way to reduce the file size of a GIF image is to reduce the number of colors stored in the file. GIF images contain a maximum of 256 colors
and the fewer colors an image has the smaller its file size. Images suitable to GIFs are graphic files using flat areas of color like an illustration or graphic image of text.

Color Depth
Graphics programs refer to the number of colors in a file as color depth or bit depth. Bit depth determines the number of colors a pixel value can represent. In most cases the larger the bit depth, the more colors, the better the graphics, and the larger the file size. Fortunately, most graphics programs eliminate the guesswork by letting you preview an image at a selected color depth before you export.

COLOR DEPTH CHART
1 bit
=
2 colors
2 bits
=
4 colors
3 bits
=
8 colors
4 bits
=
16 colors
5 bits
=
32 colors
6 bits
=
64 colors
7 bits
=
128 colors
8 bits
=
256 colors

 

Each GIF is annotated in what color depth it was exported and the resulting file size. You can see there is very little difference between the 256, 128, 64, and 32 color images. This graphic's optimum color depth would be 32 colors (5bit) or 16 colors (4bit).


256 colors
3.45k

128 colors
2.98k

64 colors
2.81k

32 colors
2.30k

16 colors
1.81k

8 colors
1.4k

4 colors
1.02k

2 colors
.7k

JPG Optimization
JPG, useful for photographs or other complex images with continuous color, can compress and reduce significantly in file size. The greater the compression the smaller the file size.

Quality Control
Graphics programs usually refer to the rate of JPG compression as Quality. By making adjustments down in quality the image lessens in color (or quality) and thereby reduces the file size. Some programs express this quality as a percentage of the original image and other programs as a 1-10 rating system where 1 is the lowest quality and 10 the highest. For the best results use your graphics program preview options to experiment with quality.

Each JPG is annotated in what quality rate it was exported and the resulting file size. JPGs (particularly this small) reduce very well. Photographic images represent many more colors than the human eye can perceive so information sometimes lost through compression is beyond the range of vision.

This graphic's optimum Quality would be around 60% of the original saving a great deal in file size.


100 %
11.74k

90%
5k

80%
3.55k

70%
2.89k

60%
2.51k

50%
2.23k

40%
1.99k

30%
1.73k

True vs. Web Formats
JPG and GIF compression compromises the quality of the original image. These formats actually lose information when saving and compressing a file. That information can never be recovered. When you need to save or keep a copy of an image for further editing or to use in other circumstances save the original in a format that records the image correctly without losing any details. These are sometimes called "true formats". Most graphics programs offer an Export or Save As command to let you safely export separate JPG and GIF images for posting on the Internet, saving the original as a true image format. Images can often be saved in the proprietary format of your graphics program. As an example, Photoshop files (files ending in a .psd extension) can retain all the information of original artwork and are readily read by a variety of other programs.

 

  top of page | next