The GIF file format

GIF is a file format that is meant for use on the internet. It should not really be used for prepress. Unfortunately, GIF images keep popping up in pages made by amateurs so it is worthwhile to know a bit about the format. You can also use this description to explain to people why GIF is not suited for prepress use.

General information

GIF is the abbreviation of Graphics Interchange Format. It was originally developed by CompuServe (an on-line service that was pretty successful in the early nineties). The format includes some key features which make it a unique and valuable format for the internet. These features include file compression, transparency, interlacing and storage of multiple images within a single file which allows for a primitive form of animation.

There are two versions of the GIF format; versions 87a and 89a. These versions were released in 1987 and 1989 respectively.

  • GIF 87a: the initial version of the GIF file format supported LZW file compression, interlacing, 256-color palettes and multiple image storage.
  • Version 89a added background transparency and a few other additions such as delay times and image replacement parameters to make the multiple image storage feature more useful for animation.

Because the LZW compression algorithm that is used in GIF is copyright protected, a new standard has been developed, based on a free compression algorithm. This successor, called PNG, has basically replaced GIF except when GIFs animation features are useful.

Features of the GIF format

This is an overview of the different features of the GIF file format, from the perspective of a prepress operator.

Limited color palette

A GIF image can contain 2, 4, 8, 16, 32, 64, 128 or 256 colors which are stored in a color palette or color lookup table within the image file. Each color in the GIF color table is described in RGB values, with each value having a range of 0 to 255. CMYK colors are not possible in GIF. Although the GIF format has access to over 16.8 million colors, only a maximum of 256 can be referenced within a single GIF image. While this limited palette keeps down file size and is perfectly acceptable for on-screen viewing, it leads to posterized images when they are printed. Most preflight tools like PitStop can generate a warning when they encounter images with a fixed color palette.

Dithering

The limited number of colors in GIF is used to limit the file size of images. While a small image using 256 colors may take up 9.5 K, the same image using 32 colors takes up only 4.4 K and going down to 16 colors get it down to 1.9 K. Another trick that is used to limit the file size is dithering. This technique is used to create the illusion of greater color depth by blending a smaller number of colored ‘dots’ together. When fewer colors are able to be displayed than are present in the original image, then patterns of adjacent pixels are used to simulate the appearance of the underrepresented colors. Dithering is not really a feature of GIF, it is simply a technique that is often used within GIF images. Dithering adds noise to the image and it reduces sharpness.

LZW compression

GIF supports LZW compression, which is a lossless compression algorithm that is also used frequently in prepress. TIFF images, for example, are also often LZW compressed.

Transparency

Transparency is the feature of the GIF89a format which allows for the specification of one of the colors in the palette to be ignored while processing the image for your display device. While this feature works great on the internet, it is not supported by layout applications, which rely on PSD-files or EPS-images with an included mask to achieve the same functionality (but with a much smoother edge around images).

Interlacing

Interlacing is another web-specific feature of GIF. It is a mechanism that makes images appear faster on-screen by first displaying a low-res version of the image and gradually showing the full version. Physically, an interlaced GIF just has the scanlines stored in an unusual order:

  • The first pass has pixel rows 1, 9, 17, etc (every eighth row)
  • The second pass has rows 5, 13, 21, etc. (every remaining fourth row)
  • The third pass has rows 3, 7, 11, 15, etc. (every remaining odd row)
  • The last pass has rows 2, 4, 6, etc. (all the even-numbered rows).

How the web browser chooses to display this is up to the browser. This feature cannot be used by prepress software.

Animation

The GIF89a specifications add a few enhancements to the file header which allows browsers such as Netscape to display multiple GIF images in a timed and/or looped sequence. This mechanism allows for small, rather crude animations and it is a very popular feature that used often used in banners. This feature is of no use for prepress software.

Resolution

Although GIF does not require a specific resolution, most GIF images have a resolution between 72 and 90 dpi, ideal for on-screen viewing but insufficient for prepress use.

Specsheet

Name: GIF
Developer: CompuServe
Release date: 1987
Type of data: bitmap
Number of colors: 2, 4, 8, 16, 32, 64, 128 or 256
Color spaces: RGB
Compression algorithms: LZW
Ideal use: internet publishing
Extension on PC-platform: .gif
Macintosh file type: ?
Special features: support for transparency, interlacing, and animation
Remarks:

3 January 2017

10 responses to “The GIF file format”

  1. Ms says:

    Please justify or confirm
    Is this message right
    IMPORTANT MESSAGE:
    *VERY DANGEROUS*
    *GIF IMAGE(Graphics Interchange Format)*💀☠💀☠💀☠

    This is a request to ALL my Friends on WhatsApp.
          Please STOP sending GIF greetings or messages as they damage the battery apart from eating into the GBs/MBs.
         As you all know batteries once gone cannot be replaced these days unless you buy duplicate/spurious stuff.
        If you receive GIF forwards please DELETE immediately not only from the CHAT but also from the GALLERY.
              *GIF files keep running continuously in the Gallery even if you Delete from the Chat.* In fact they start running from the time they enter your mobile until such time you delete it. 💀☠
              Please Delete when you receive and please don’t forward to others too. 👎👎
    Thank you. Cheers…

    P.S.
    Kindly Save this message & fwd to your Relatives & Friends who are not Aware of “GIF” messages. Thanks again.

  2. Aldente says:

    Hi…
    I just completed a retouching job of a model’s face and want to create a .gif file of ‘before’ and ‘after’.
    However, when I look at the resulting image (shrunk to about 800 x 600), the ‘after’ image shows some ugly graininess, almost like “droplets” all around the face of a model, pretty much nullifying all my work.

    Can someone explain to me what (if anything) could be done to remedy the situation and what settings or whatever I should use, since at present this .gif is absolutely unacceptable.

    Thanx.

    • Laurens says:

      The only thing you can do is make sure you use an application that does the best possible mapping of all of the colors in your artwork to the limited palette supported by GIF. There might be apps that are better than Photoshop to do this.

  3. matrix mykloader says:

    really good information’s delivered,.. this has helped me know more about GIF file format. thank you a lot

  4. Jim says:

    GIF was one of the first two image formats commonly used on Web sites, the other being the black and white XBM. JPEG came later with the Mosaic browser

  5. Lin says:

    hi I need gif on my pc but I don’t know how to get it? please help 🙂

    • Laurens says:

      GIF is a file format, not an application. Maybe it was an illusion to think that this page made that clear.

  6. Veeraragavan says:

    Mr.newbie,
    gif file might have been corrupted.
    What is the application in which you tried to open it?
    Windows Picture and Fax viewer,
    Microsoft Photo Editor,
    MS Paint,
    Adobe Photoshop,
    ImageReady…..?
    What is actually happening while opening it?

  7. newbie says:

    I received three pictures in an email…one had a .jpg extention and the other two a .gif extention…the .jpg file opened and I can not get the .gif files to open to see the pictures….what do I do……step by step please……..lol

Leave a Reply

Your email address will not be published. Required fields are marked *


Advertising