Misplaced Pages

Adam7 algorithm: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 20:22, 12 April 2011 editSmjg (talk | contribs)Extended confirmed users, Pending changes reviewers26,861 editsm oops← Previous edit Latest revision as of 07:09, 18 February 2024 edit undoAnomieBOT (talk | contribs)Bots6,559,689 editsm Dating maintenance tags: {{Why}} 
(31 intermediate revisions by 23 users not shown)
Line 1: Line 1:
{{Short description|Interlacing algorithm for raster images}}
{{About|the interlacing scheme for images|the gene|ADAM7}}
] ]
]

'''Adam7''' is an ] ] for ]s, best known as the interlacing scheme optionally used in ] images. An Adam7 interlaced image is broken into seven subimages, which are defined by replicating this 8×8 pattern across the full image. '''Adam7''' is an ] ] for ]s, best known as the interlacing scheme optionally used in ] images. An Adam7 interlaced image is broken into seven subimages, which are defined by replicating this 8×8 pattern across the full image.


{| style="margin: 1em auto; background: transparent;"
<center>
{| style="background: transparent;"
| |
<pre>1 6 4 6 2 6 4 6 <pre>1 6 4 6 2 6 4 6
Line 14: Line 17:
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
</pre> </pre>
|}
|}</center>


The subimages are then stored in the image file in numerical order. 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 ]. This means the whole image can be perceived much more quickly in the early passes, particularly if interpolation algorithms such as ] are used.<ref></ref> Adam7 uses seven passes and operates in both dimensions, compared to only four passes in the vertical dimension used by ]. 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 ] are used.<ref></ref>


== History == == History ==
Adam7 is named after Adam M. Costello, who suggested the method on January 30, 1995, based on this five-pass scheme that had earlier been proposed by ]:<ref>{{cite mailing list |url= |title= Re: CRC |date= 30 Jan 1995 |accessdate=2010-01-29 |mailinglist= png-list |last= Costello |first= Adam M. |quote= By the way, what would folks think of a Lee-style 7-pass scheme? Just Adam7 is named after Adam M. Costello, who suggested the method on February 2, 1995, and after the seven steps involved.
the same thing, but starting with a 1/64 image? That would make the
initial large pixels 8x8. |archiveurl= http://pmt.sourceforge.net/mailing-lists/png-list/png-list.199501.gz |archivedate= ?|ref= }}</ref>


It is a rearrangement<ref>{{cite mailing list |title= interlacing revisited: the Adam7 scheme |date= 2 Feb 1995 |accessdate=2016-04-18 |mailing-list= png-list |last= Costello |first= Adam M. |quote= I rearranged the Lee7 scheme a bit (Lee7 is the obvious extension to Lee's 5-pass scheme), coming up with the Adam7 scheme |url= http://pmt.sourceforge.net/mailing-lists/png-list/png-list.199502.gz }}</ref> of this five-pass scheme<ref>{{cite mailing list |title= Interlace methods: visual testing |date= 1 Feb 1995 |accessdate=2016-04-18 |mailing-list= png-list |last= Lane |first= Tom |quote= Lee Crocker's 5-pass 2-D interlace proposal |url= http://pmt.sourceforge.net/mailing-lists/png-list/png-list.199502.gz }}</ref> that had earlier been proposed by ]:
<center>
{| style="background: transparent;" {| style="margin: 1em auto; background: transparent;"
|----- |-----
| |
<pre>1 4 2 4 <pre>1 5 3 5
5 5 5 5 5 4 5 4
3 4 3 4 3 5 2 5
5 5 5 5 5 4 5 4
</pre> </pre>
|}
|}</center>
Alternative speculative proposals at the time included square spiral interlacing and using ]s, but these were rejected as over-complicated. Alternative speculative proposals at the time included square spiral interlacing and using ]s, but these were rejected as being overcomplicated.


== Passes == == Passes ==
The pixels included in each pass, and the total pixels encoded at that point are as follows: The pixels included in each pass, and the total pixels encoded at that point are as follows:
<gallery> <gallery>
File:Adam7 pass 1.gif|Pass 1, 1/64 = 1.5625% File:Adam7_pass_1.png|Pass 1, 1/64 = 1.5625%
File:Adam7 pass 2.gif|Pass 2, 1/32 = 3.125% File:Adam7_pass_2.png|Pass 2, 1/32 = 3.125%
File:Adam7 pass 3.gif|Pass 3, 1/16 = 6.25% File:Adam7_pass_3.png|Pass 3, 1/16 = 6.25%
File:Adam7 pass 4.gif|Pass 4, 1/8 = 12.5% File:Adam7_pass_4.png|Pass 4, 1/8 = 12.5%
File:Adam7 pass 5.gif|Pass 5, 1/4 = 25% File:Adam7_pass_5.png|Pass 5, 1/4 = 25%
File:Adam7 pass 6.gif|Pass 6, 1/2 = 50% File:Adam7_pass_6.png|Pass 6, 1/2 = 50%
File:Adam7 pass 7.gif|Pass 7, 1/1 = 100% File:Adam7_pass_7.png|Pass 7, 1/1 = 100%
</gallery> </gallery>
When rendering, the image will generally be interpolated at earlier stages, rather than just these pixels being rendered. When rendering, the image will generally be interpolated at earlier stages, rather than just these pixels being rendered.
Line 55: Line 56:
=== Iteration === === Iteration ===
Adam7 arises from iteration of the following pattern: Adam7 arises from iteration of the following pattern:
{| style="margin: 1em auto; background: transparent;"
<center>
{| style="background: transparent;"
|----- |-----
| |
Line 62: Line 62:
33 33
</pre> </pre>
|}
|}</center>
which may be interpreted as "folding" in the vertical and horizontal dimensions. Similarly, GIF interlacing <tt>1324</tt> can be seen as iteration of the <tt>12</tt> pattern, but only in the vertical direction (<tt>12</tt> expands to <tt>1.2.</tt> which is filled in as <tt>1324</tt>). which may be interpreted as "folding" in the vertical and horizontal dimensions. Similarly, GIF interlacing {{samp|1324}} can be seen as iteration of the {{samp|12}} pattern, but only in the vertical direction ({{samp|12}} expands to {{samp|1.2.}} which is filled in as {{samp|1324}}).


Using this 3-pass pattern means the first pass is (1/2)<sup>2</sup>&nbsp;=&nbsp;1/4 (25%) of the image. Using this 3-pass pattern means the first pass is (1/2)<sup>2</sup>&nbsp;=&nbsp;1/4 (25%) of the image.


Iterating this pattern once yields Crocker's 5-pass scheme; after 3 passes this yields Iterating this pattern once yields a 5-pass scheme; after 3 passes this yields
{| style="margin: 1em auto; background: transparent;"
<center>
{| style="background: transparent;"
|----- |-----
| |
Line 77: Line 76:
. . . . . . . .
</pre> </pre>
|}
|}</center>
which is then filled in to: which is then filled in to:
{| style="margin: 1em auto; background: transparent;"
<center>
{| style="background: transparent;"
|----- |-----
| |
Line 88: Line 86:
5 5 5 5 5 5 5 5
</pre> </pre>
|}
|}</center>
In the 5-pass pattern, the first pass (1/4)<sup>2</sup>&nbsp;=&nbsp;1/16 (6.25%) of the image. In the 5-pass pattern, the first pass (1/4)<sup>2</sup>&nbsp;=&nbsp;1/16 (6.25%) of the image.


Iterating again yields the 7-pass Adam7 scheme, where the first pass (1/8)<sup>2</sup>&nbsp;=&nbsp;1/64 (1.5625%) of the image. Iterating again yields the 7-pass Adam7 scheme, where the first pass (1/8)<sup>2</sup>&nbsp;=&nbsp;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 sizes 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 size and connection speeds in question), a 7-pass scheme was seen as sufficient, and preferable to a simple 5-pass scheme. 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,{{why|date=February 2024}} and preferable to a simple 5-pass scheme.


== References == == References ==
Line 102: Line 100:


] ]
]

]
]
]
]
]

Latest revision as of 07:09, 18 February 2024

Interlacing algorithm for raster images This article is about the interlacing scheme for images. For the gene, see ADAM7.
An illustration of Adam7 interlacing over a 16×16 image
An image being displayed using the 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

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.

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 of this five-pass scheme 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:

  • Pass 1, 1/64 = 1.5625% Pass 1, 1/64 = 1.5625%
  • Pass 2, 1/32 = 3.125% Pass 2, 1/32 = 3.125%
  • Pass 3, 1/16 = 6.25% Pass 3, 1/16 = 6.25%
  • Pass 4, 1/8 = 12.5% Pass 4, 1/8 = 12.5%
  • Pass 5, 1/4 = 25% Pass 5, 1/4 = 25%
  • Pass 6, 1/2 = 50% Pass 6, 1/2 = 50%
  • Pass 7, 1/1 = 100% Pass 7, 1/1 = 100%

When rendering, the image will generally be interpolated at earlier stages, rather than just these pixels being rendered.

Related algorithms

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) = 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) = 1/16 (6.25%) of the image.

Iterating again yields the 7-pass Adam7 scheme, where the first pass (1/8) = 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.

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

External links

Categories: