TCF389: Graphics, Part I

Optimizing Images for the Web
Or, Low-Bandwidth Graphics

The Web requires the smallest files possible in order to minimize the time it takes a page to display

Pixels, Pixels, Pixels: Resolution

EXERCISE: shrink a picture and check file size

Bit Depth: I.e., Numbers of Colors

Exercise: Take the 256-color image below, reduce its bit depth, and then check the file sizes (keep it in GIF format).

Cowboys256color.gif

File Formats

GIF JPEG
cartoon-like images photographic images
solid fields of color subtly gradated colors
256 colors maximum: requires Indexed Mode unlimited # of colors: requires RGB Mode
transparency nope
interlacing "progressive" JPEG
animation (GIF89a): discussed on Thursday nope
fixed lossless compression (Weinman, p. 48) user chooses amount of compression (Weinman, p. 58)

Compressing JPEG: Step-by-Step

  1. JPEG options in Photoshop and LView use different terminology for the same effects. Here are the "JPEG options" dialog boxes for both apps (Photoshop is on the left):
    PSJPEGOptions.gif LViewJPEGoptions.gif
  2. Photoshop: Setting a smaller "Quality" number makes for a smaller file and a poorer image. Your choices are 0-10.
    LView: Setting a smaller "Compression Quality Factor" does the same thing. Your choices are 0-100.
  3. Here's an example of "0" and "10" Quality settings in Photoshop. See also, Weinman's examples (p. 58).

GIF vs JPEG examples

  1. See Weinman's many examples (especially p. 56 for JPEG and GIF comparison; and pp. 88-109)
  2. Cartoon-like image
  3. Photographic image

Exercise: change a GIF to JPEG and a JPEG to GIF, then compare file sizes

GIF Color Depth, Transparency, and Interleaving Examples


References

Lynda Weinman, Designing Web Graphics.2 (Indianapolis, IN: New Riders Publishing, 1996). Available at a discount from www.amazon.com, online bookstore. The best and most comprehensive book on creating images specifically for the Web.