Portable Network Graphics (PNG)
In the “GNU’s Not Unix” tradition of recursive acronyms, PNG may unofficially be taken to stand for “PNG’s Not GIF.” PNG was designed as an open standard alternative to GIF, and it plays that role very well. PNG will not completely replace GIF, however, if only because PNG can only store one image per file[7] and there are a million web pages out there that are full of GIF images.
A PNG file is assembled as a series of chunks which, for all intents and purposes, are the equivalent of GIF’s blocks. PNG just has a friendlier name for the structure. The 1.0 PNG specification defines a number of standard chunks, of which four are considered “critical chunks.” At least three of the critical chunks must be present in every valid PNG format file. The non-critical standard chunks are sometimes called “ancillary chunks.” The critical and ancillary chunks, along with a short description of each, are listed in Table 1.2 and Table 1.3. Critical chunk codes begin with a capital letter; ancillary chunks begin with a lowercase letter.
Table 1-2. Critical Chunks
|
Name |
Description |
Code |
|---|---|---|
|
Header chunk |
Global information about the image |
IHDR |
|
Palette chunk |
A palette (optional) |
PLTE |
|
Image Data chunk |
The compressed image data |
IDAT |
|
Image End chunk |
The end-of-file marker |
IEND |
Table 1-3. Ancillary Chunks
|
Name |
Description |
Code |
|---|---|---|
|
Background Color chunk |
Defines a background color index in palette or a background shade for a grayscale or RGB image. |
bKGD |
|
Primary ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access