Graphics Interchange Format - Interlacing

Interlacing

The GIF Specification allows each image within the logical screen of a GIF file to specify that it is interlaced; i.e., that the order of the raster lines in its data block is not sequential. This allows a partial display of the image that can be recognized before the full image is painted.

An interlaced image is divided from top to bottom into strips 8 pixels high, and the rows of the image are presented in the following order:

  • Pass 1: Line 0 (the top-most line) from each strip.
  • Pass 2: Line 4 from each strip.
  • Pass 3: Lines 2 and 6 from each strip.
  • Pass 4: Lines 1, 3, 5, and 7 from each strip.

The pixels within each line are not interlaced, but presented consecutively from left to right. As with non-interlaced images, there is no break between the data for one line and the data for the next. The indicator that an image is interlaced is a bit set in the image's header block.

Read more about this topic:  Graphics Interchange Format