Task 564: .PNG File Format
Task 564: .PNG File Format
PNG File Format Specifications
The official specifications for the .PNG file format are detailed in the Portable Network Graphics (PNG) Specification (Third Edition) published by the W3C on June 24, 2025. This edition includes updates for HDR support, official EXIF integration, and animated PNG (APNG) enhancements. The format is designed for lossless, portable, well-compressed storage of raster images, supporting static and animated content with features like transparency, color management, and metadata.
- List of all properties of this file format intrinsic to its file system:
Based on the specification, the intrinsic properties refer to the structural elements and metadata fields embedded within the PNG file structure. These include the file signature, chunk formats, and data fields from critical and ancillary chunks. Here's a comprehensive list:
- File Signature: An 8-byte sequence:
89 50 4E 47 0D 0A 1A 0A(in hexadecimal), identifying the file as PNG. - General Chunk Properties (applies to all chunks):
- Length: 4-byte unsigned integer (0 to 2^31-1).
- Type: 4-byte ASCII code (e.g., 'IHDR'); bits indicate critical/ancillary, public/private, safe-to-copy.
- Data: Variable-length bytes specific to the chunk type.
- CRC: 4-byte cyclic redundancy check for error detection.
- Critical Chunk Properties:
- IHDR (Image Header):
- Width: 4-byte unsigned integer (>0).
- Height: 4-byte unsigned integer (>0).
- Bit depth: 1 byte (1, 2, 4, 8, or 16, depending on color type).
- Color type: 1 byte (0=greyscale, 2=truecolor, 3=indexed-color, 4=greyscale+alpha, 6=truecolor+alpha).
- Compression method: 1 byte (0=deflate/zlib).
- Filter method: 1 byte (0=adaptive filtering).
- Interlace method: 1 byte (0=none, 1=Adam7).
- PLTE (Palette) (optional, required for color type 3):
- Palette entries: Array of 3-byte RGB values (1-256 entries).
- IDAT (Image Data) (one or more):
- Compressed data: zlib/deflate stream of filtered scanlines.
- IEND (Image Trailer):
- No data (empty).
- Ancillary Chunk Properties:
- tRNS (Transparency) (optional, for color types 0, 2, 3):
- Transparent color or alpha values: Varies by color type (e.g., 2-byte greyscale for type 0, array of 1-byte alphas for type 3).
- cHRM (Primary Chromaticities and White Point):
- White point x/y: 4 bytes each.
- Red x/y: 4 bytes each.
- Green x/y: 4 bytes each.
- Blue x/y: 4 bytes each.
- gAMA (Image Gamma):
- Gamma value: 4-byte unsigned integer (×100000).
- iCCP (Embedded ICC Profile):
- Profile name: 1-79 bytes.
- Compression method: 1 byte (0=zlib).
- Compressed profile: Variable bytes.
- sBIT (Significant Bits):
- Significant bits per channel: 1-4 bytes depending on color type.
- sRGB (Standard RGB Color Space):
- Rendering intent: 1 byte (0=perceptual, 1=relative colorimetric, 2=saturation, 3=absolute colorimetric).
- cICP (Coding-Independent Code Points):
- Color primaries: 1 byte.
- Transfer function: 1 byte.
- Matrix coefficients: 1 byte.
- Video full range flag: 1 byte.
- mDCV (Mastering Display Color Volume):
- Chromaticities for R/G/B/white point: Multiple 4-byte values.
- Max/min luminance: 4 bytes each.
- iTXt (International Textual Data) (multiple allowed):
- Keyword: 1-79 bytes.
- Compression flag/method: 1 byte each.
- Language tag: Variable bytes.
- Translated keyword: Variable bytes.
- Text: Variable bytes (UTF-8).
- tEXt (Textual Data) (multiple allowed):
- Keyword: 1-79 bytes.
- Text: Variable bytes (Latin-1).
- zTXt (Compressed Textual Data) (multiple allowed):
- Keyword: 1-79 bytes.
- Compression method: 1 byte.
- Compressed text: Variable bytes.
- bKGD (Background Color):
- Background color: Varies by color type (e.g., 6 bytes for truecolor).
- hIST (Image Histogram):
- Frequencies: 2 bytes per palette entry.
- pHYs (Physical Pixel Dimensions):
- Pixels per unit X/Y: 4 bytes each.
- Unit: 1 byte (0=unknown, 1=meters).
- sPLT (Suggested Palette) (multiple allowed):
- Palette name: 1-79 bytes.
- Sample depth: 1 byte (8 or 16).
- Entries: Variable (RGB/alpha/frequency per entry).
- eXIf (EXIF Information):
- EXIF data: Variable bytes (per EXIF spec).
- tIME (Image Last Modification Time):
- Year: 2 bytes.
- Month/Day/Hour/Minute/Second: 1 byte each.
- cLLI (Content Light Level Information):
- Max content light level: 4 bytes.
- Max frame-average light level: 4 bytes.
- Animation Properties (APNG):
- acTL (Animation Control):
- Number of frames: 4 bytes.
- Number of plays: 4 bytes (0=infinite).
- fcTL (Frame Control) (one per frame):
- Sequence number: 4 bytes.
- Width/height: 4 bytes each.
- X/Y offset: 4 bytes each.
- Delay num/den: 2 bytes each.
- Dispose op: 1 byte.
- Blend op: 1 byte.
- fdAT (Frame Data) (one or more per frame):
- Sequence number: 4 bytes.
- Frame data: Variable bytes (zlib-compressed).
- Other Intrinsic Properties:
- Image types: Greyscale, truecolor, indexed, with/without alpha.
- Sample depth scaling: Recorded in sBIT.
- Filtering: Scanline filters (none, sub, up, average, Paeth).
- Compression: zlib/deflate across IDAT/fdAT.
- Color space: Specified via cICP, iCCP, sRGB, gAMA+cHRM.
- Interlacing: Adam7 (7 passes) or none.
- Media type: image/png or image/apng.
Two direct download links for .PNG files:
- https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png
- https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png
Ghost blog embedded HTML JavaScript for drag-and-drop PNG property dump:
## PNG File Format Specifications The official specifications for the .PNG file format are detailed in the Portable Network Graphics (PNG) Specification (Third Edition) published by the W3C on June 24, 2025. This edition includes updates for HDR support, official EXIF integration, and animated PNG (APNG) enhancements. The format is designed for lossless, portable, well-compressed storage of raster images, supporting static and animated content with features like transparency, color management, and metadata. 1. **List of all properties of this file format intrinsic to its file system**: Based on the specification, the intrinsic properties refer to the structural elements and metadata fields embedded within the PNG file structure. These include the file signature, chunk formats, and data fields from critical and ancillary chunks. Here's a comprehensive list: - **File Signature**: An 8-byte sequence: `89 50 4E 47 0D 0A 1A 0A` (in hexadecimal), identifying the file as PNG. - **General Chunk Properties** (applies to all chunks): - Length: 4-byte unsigned integer (0 to 2^31-1). - Type: 4-byte ASCII code (e.g., 'IHDR'); bits indicate critical/ancillary, public/private, safe-to-copy. - Data: Variable-length bytes specific to the chunk type. - CRC: 4-byte cyclic redundancy check for error detection. - **Critical Chunk Properties**: - **IHDR (Image Header)**: - Width: 4-byte unsigned integer (>0). - Height: 4-byte unsigned integer (>0). - Bit depth: 1 byte (1, 2, 4, 8, or 16, depending on color type). - Color type: 1 byte (0=greyscale, 2=truecolor, 3=indexed-color, 4=greyscale+alpha, 6=truecolor+alpha). - Compression method: 1 byte (0=deflate/zlib). - Filter method: 1 byte (0=adaptive filtering). - Interlace method: 1 byte (0=none, 1=Adam7). - **PLTE (Palette)** (optional, required for color type 3): - Palette entries: Array of 3-byte RGB values (1-256 entries). - **IDAT (Image Data)** (one or more): - Compressed data: zlib/deflate stream of filtered scanlines. - **IEND (Image Trailer)**: - No data (empty). - **Ancillary Chunk Properties**: - **tRNS (Transparency)** (optional, for color types 0, 2, 3): - Transparent color or alpha values: Varies by color type (e.g., 2-byte greyscale for type 0, array of 1-byte alphas for type 3). - **cHRM (Primary Chromaticities and White Point)**: - White point x/y: 4 bytes each. - Red x/y: 4 bytes each. - Green x/y: 4 bytes each. - Blue x/y: 4 bytes each. - **gAMA (Image Gamma)**: - Gamma value: 4-byte unsigned integer (×100000). - **iCCP (Embedded ICC Profile)**: - Profile name: 1-79 bytes. - Compression method: 1 byte (0=zlib). - Compressed profile: Variable bytes. - **sBIT (Significant Bits)**: - Significant bits per channel: 1-4 bytes depending on color type. - **sRGB (Standard RGB Color Space)**: - Rendering intent: 1 byte (0=perceptual, 1=relative colorimetric, 2=saturation, 3=absolute colorimetric). - **cICP (Coding-Independent Code Points)**: - Color primaries: 1 byte. - Transfer function: 1 byte. - Matrix coefficients: 1 byte. - Video full range flag: 1 byte. - **mDCV (Mastering Display Color Volume)**: - Chromaticities for R/G/B/white point: Multiple 4-byte values. - Max/min luminance: 4 bytes each. - **iTXt (International Textual Data)** (multiple allowed): - Keyword: 1-79 bytes. - Compression flag/method: 1 byte each. - Language tag: Variable bytes. - Translated keyword: Variable bytes. - Text: Variable bytes (UTF-8). - **tEXt (Textual Data)** (multiple allowed): - Keyword: 1-79 bytes. - Text: Variable bytes (Latin-1). - **zTXt (Compressed Textual Data)** (multiple allowed): - Keyword: 1-79 bytes. - Compression method: 1 byte. - Compressed text: Variable bytes. - **bKGD (Background Color)**: - Background color: Varies by color type (e.g., 6 bytes for truecolor). - **hIST (Image Histogram)**: - Frequencies: 2 bytes per palette entry. - **pHYs (Physical Pixel Dimensions)**: - Pixels per unit X/Y: 4 bytes each. - Unit: 1 byte (0=unknown, 1=meters). - **sPLT (Suggested Palette)** (multiple allowed): - Palette name: 1-79 bytes. - Sample depth: 1 byte (8 or 16). - Entries: Variable (RGB/alpha/frequency per entry). - **eXIf (EXIF Information)**: - EXIF data: Variable bytes (per EXIF spec). - **tIME (Image Last Modification Time)**: - Year: 2 bytes. - Month/Day/Hour/Minute/Second: 1 byte each. - **cLLI (Content Light Level Information)**: - Max content light level: 4 bytes. - Max frame-average light level: 4 bytes. - **Animation Properties (APNG)**: - **acTL (Animation Control)**: - Number of frames: 4 bytes. - Number of plays: 4 bytes (0=infinite). - **fcTL (Frame Control)** (one per frame): - Sequence number: 4 bytes. - Width/height: 4 bytes each. - X/Y offset: 4 bytes each. - Delay num/den: 2 bytes each. - Dispose op: 1 byte. - Blend op: 1 byte. - **fdAT (Frame Data)** (one or more per frame): - Sequence number: 4 bytes. - Frame data: Variable bytes (zlib-compressed). - **Other Intrinsic Properties**: - Image types: Greyscale, truecolor, indexed, with/without alpha. - Sample depth scaling: Recorded in sBIT. - Filtering: Scanline filters (none, sub, up, average, Paeth). - Compression: zlib/deflate across IDAT/fdAT. - Color space: Specified via cICP, iCCP, sRGB, gAMA+cHRM. - Interlacing: Adam7 (7 passes) or none. - Media type: image/png or image/apng. 2. **Two direct download links for .PNG files**: - https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png - https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png 3. **Ghost blog embedded HTML JavaScript for drag-and-drop PNG property dump**: ```html