Graphics, Part IV: Transparent GIFs

Transparent Images

Transparent GIFs in Photoshop: Step-By-Step

  1. Even though "CompuServe GIF" is a choice in Photoshop's "Save As" dialog box, you cannot create a transparent GIF this way!
    Instead, you must go to the File Menu and select Export and then GIF89a Export...
    Photoshop GIF89a Export dialog box.
  2. With the Photoshop eyedropper tool. eyedropper tool selected (as above), click on the area that you want to be transparent. This selects the color of that area to be transparent. Photoshop indicates this by turning that color gray (as above).
    (A palette showing all the colors in the image is displayed, too. You can also use the eyedropper to select from there.)
  3. Select "OK" and you're done!
    Transparent, aliased GIF.

The Anti-aliasing Issue

Exercise: Create an aliased image using the antialiased image, PSantialias.gif; then insert it into a Web page with a colored background.


Transparent GIFs from a Photographic Original

Using a Photograph for your transparent GIF can be tricky because of the ill-defined edges in a photograph. Lynda Weinman explains, step-by-step, how to get around that problem in Photoshop.

  1. Begin, naturally, by scanning an image such as this dorky one of me sitting on the World's Ugliest Couch.
  2. Prepare to use it as a GIF by converting the Image Mode to Indexed Color. Then save it as a Compuserve GIF file.
  3. Select the Lasso Tool from the toolbar.
  4. So, trace (drag the cursor) an outline of the part of the image you wish to use.
  5. My big head is now selected, but actually I want to select everything but my head so that I can manipulate it. To do this, I must invert the selection by going to the Select Menu and choosing Inverse. It looks the same, but now everything but my head is selected.
  6. I now turn everything but my head white (although other colors could be used) by
    1. Making sure the Foreground Color is set to white.
    2. Choosing the Edit Menu, then Fill; then setting Contents to Foreground Color and Opacity to 100%. My head now floats in a field of white.

  7. Turn off the selection by going to the Select Menu and choosing None.
  8. Export the image as a GIF file and turn the white portion transparent (as explained above). Voila!


Bibliography

Lynda Weinman, Designing Web Graphics .2 (Indianapolis, IN: 1996), 166-87.


Last revised: July 19, 1999
Comments: jbutler@ua.edu