Adam7 is an interlacing algorithm for raster images, best known as the interlacing scheme optionally used in PNG images. An Adam7 interlaced image is broken into seven subimages, which are defined by replicating this 8×8 pattern across the full image.
The subimages are then stored in the image file in numerical order.
Adam7 uses seven passes and operates in both dimensions, compared to only four passes in the vertical dimension used by GIF. This means that an approximation of the entire image can be perceived much more quickly in the early passes, particularly if interpolation algorithms such as bicubic interpolation are used.
Adam7 is named after Adam M. Costello, who suggested the method on February 2, 1995, and after the seven steps involved.
It is a rearrangement of this five-pass scheme that had earlier been proposed by Lee Daniel Crocker:
Alternative speculative proposals at the time included square spiral interlacing and using Peano curves, but these were rejected as being overcomplicated.
The pixels included in each pass, and the total pixels encoded at that point are as follows:
Pass 1, 1/64 = 1.5625%
Pass 2, 1/32 = 3.125%
Pass 3, 1/16 = 6.25%
Pass 4, 1/8 = 12.5%
Pass 5, 1/4 = 25%
Pass 6, 1/2 = 50%
Pass 7, 1/1 = 100%
When rendering, the image will generally be interpolated at earlier stages, rather than just these pixels being rendered.
Adam7 is a multiscale model of the data, similar to a discrete wavelet transform with Haar wavelets, though it starts from an 8×8 block, and downsamples the image, rather than decimating (low-pass filtering, then downsampling). It thus offers worse frequency behavior, showing artifacts (pixelation) at the early stages, in return for simpler implementation.