Adam7 algorithm

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.

1 6 4 6 2 6 4 6
7 7 7 7 7 7 7 7
5 6 5 6 5 6 5 6
7 7 7 7 7 7 7 7
3 6 4 6 3 6 4 6
7 7 7 7 7 7 7 7
5 6 5 6 5 6 5 6
7 7 7 7 7 7 7 7
An illustration of Adam7 interlacing over a 16×16 image
An image being displayed using the Adam7 algorithm.

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.[1]

History

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[2] of this five-pass scheme[3] that had earlier been proposed by Lee Daniel Crocker:

1 5 3 5
5 4 5 4
3 5 2 5
5 4 5 4

Alternative speculative proposals at the time included square spiral interlacing and using Peano curves, but these were rejected as being overcomplicated.

Passes

The pixels included in each pass, and the total pixels encoded at that point are as follows:

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.

Iteration

Adam7 arises from iteration of the following pattern:

12
33

which may be interpreted as "folding" in the vertical and horizontal dimensions. Similarly, GIF interlacing 1324 can be seen as iteration of the 12 pattern, but only in the vertical direction (12 expands to 1.2. which is filled in as 1324).

Using this 3-pass pattern means the first pass is (1/2)2 = 1/4 (25%) of the image.

Iterating this pattern once yields a 5-pass scheme; after 3 passes this yields

1 . 2 .
. . . .
3 . 3 .
. . . .

which is then filled in to:

1 4 2 4
5 5 5 5
3 4 3 4
5 5 5 5

In the 5-pass pattern, the first pass (1/4)2 = 1/16 (6.25%) of the image.

Iterating again yields the 7-pass Adam7 scheme, where the first pass (1/8)2 = 1/64 (1.5625%) of the image.

In principle this can be iterated, yielding a 9-pass scheme, an 11-pass scheme, and so forth, or alternatively an adaptive number of passes can be used, as many as the image size will allow (so the first pass consists of a single pixel), as is usual in scale-free multiscale modeling. In the context that PNG was developed (i.e., for the image sizes and connection speeds in question), a 7-pass scheme was seen as sufficient, and preferable to a simple 5-pass scheme.

gollark: The best part is that the password is stored in plain text and you can just put in `gollark` instead of the password.
gollark: *Or* I can ignore it and add it as an alias in potatOS...
gollark: ```PotatOS OS/Conveniently Self-Propagating System/Sandbox/Compilation of Useless Programs We are not responsible for- headaches- rashes- persistent/non-persistent coughs- virii- backdoors- spinal cord sclerosis- hypertension- cardiac arrest- regular arrest, by police or whatever- death- computronic discombobulation- loss of data- gain of data- frogsor any other issue caused directly or indirectly due to use of this product. Best viewed in Internet Explorer 6 running on a Difference Engine emulated under MacOS 7. Features:- Fortunes/Dwarf Fortress output/Chuck Norris jokes on boot (wait, IS this a feature?)- (other) viruses (how do you get them in the first place? running random files like this?) cannot do anything particularly awful to your computer - uninterceptable (except by crashing the keyboard shortcut daemon, I guess) keyboard shortcuts allow easy wiping of the non-potatOS data so you can get back to whatever nonsense you do fast- Skynet (rednet-ish stuff over websocket to my server) and Lolcrypt (encoding data as lols and punctuation) built in for easy access!- Convenient OS-y APIs - add keyboard shortcuts, spawn background processes & do "multithreading"-ish stuff.- Great features for other idio- OS designers, like passwords and fake loading (set potatOS.stupidity.loading [time], est potatOS.stupidity.password [password]).- Digits of Tau available via a convenient command ("tau")- Potatoplex and Loading built in ("potatoplex"/"loading") (potatoplex has many undocumented options)!- Stack traces (yes, I did steal them from MBS)- Backdoors- er, remote debugging access (it's secured, via ECC signing on disks and websocket-only access requiring a key for the other one)- All this useless random junk can autoupdate (this is probably a backdoor)!- EZCopy allows you to easily install potatOS on another device, just by sticking it in the disk drive of another potatOS device!- fs.load and fs.dump - probably helpful somehow.```
gollark: <@236628809158230018> https://pastebin.com/RM13UGFa
gollark: It, um, teaches you not to trust any OSes?

References

  1. Introduction to PNG - nuwen.net
  2. Costello, Adam M. (2 Feb 1995). "interlacing revisited: the Adam7 scheme". png-list (Mailing list). Retrieved 2016-04-18. I rearranged the Lee7 scheme a bit (Lee7 is the obvious extension to Lee's 5-pass scheme), coming up with the Adam7 scheme
  3. Lane, Tom (1 Feb 1995). "Interlace methods: visual testing". png-list (Mailing list). Retrieved 2016-04-18. Lee Crocker's 5-pass 2-D interlace proposal
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.