ImageGear for C and C++ on Linux v18.8 - Updated
PNG Metadata Structure
User Guide > File Formats and Compressions > File Formats > Metadata Structures > PNG Metadata Structure

Brief information on PNG metadata levels is provided in the set of tables below:

PNG Metadata Level

All items between items with Name "PNG" and Id IG_FORMAT_PNG (Type LEVEL_START and LEVEL_END) are interpreted as PNG data. If during sending data from application level to filter level the first item is omitted the data will not be interpreted and saved.

Name Id Type Value Type Value Value Length Read Only
"PNG" IG_FORMAT_PNG LEVEL_START 0 NULL 0 TRUE
PNG chunks levels
"PNG" IG_FORMAT_PNG LEVEL_END 0 NULL 0 TRUE

PNG Chunks Levels

The following PNG non-image chunk levels are supported by ImageGear:

PNG Header Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"IHDR" 0x49484452 LEVEL_START 0 NULL 0 TRUE
"Width" 0x49484452 VALUE_ITEM UINT32   1 TRUE
"Height" 0x49484452 VALUE_ITEM UINT32   1 TRUE
"BitDepth" 0x49484452 VALUE_ITEM UINT8   1 TRUE
"ColorType" 0x49484452 VALUE_ITEM UINT8   1 TRUE
"CompressionType" 0x49484452 VALUE_ITEM UINT8   1 TRUE
"FilterType" 0x49484452 VALUE_ITEM UINT8   1 TRUE
"InterlaceType" 0x49484452 VALUE_ITEM UINT8   1 TRUE
"IHDR" 0x49484452 LEVEL_END 0 NULL 0 TRUE

Physical Dimension Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"pHYs" 0x70485973 LEVEL_START 0 NULL 0 TRUE
"XAxis" 0x70485973 VALUE_ITEM UINT32   1 FALSE
"YAxis" 0x70485973 VALUE_ITEM UINT32   1 FALSE
"UnitSpecifier" 0x70485973 VALUE_ITEM UINT8   1 FALSE
"pHYs" 0x70485973 LEVEL_END 0 NULL 0 TRUE

Transparency Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"tRNS" 0x74524e53 VALUE_ITEM UINT8 or UINT16   Variable FALSE

Gamma Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"gAMA" 0x67414d41 VALUE_ITEM UINT32   1 FALSE

Primary Chromaticities Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"cHRM" 0x6348524d LEVEL_START 0 NULL 0 TRUE
"WhitePoint" 0x6348524d LEVEL_START 0 NULL 0 TRUE
"x" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"y" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"WhitePoint" 0x6348524d LEVEL_END 0 NULL 0 TRUE
"Red" 0x6348524d LEVEL_START 0 NULL 0 TRUE
"x" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"y" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"Red" 0x6348524d LEVEL_END 0 NULL 0 TRUE
"Green" 0x6348524d LEVEL_START 0 NULL 0 TRUE
"x" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"y" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"Green" 0x6348524d LEVEL_END 0 NULL 0 TRUE
"Blue" 0x6348524d LEVEL_START 0 NULL 0 TRUE
"x" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"y" 0x6348524d VALUE_ITEM UINT32   1 FALSE
"Blue" 0x6348524d LEVEL_END 0 NULL 0 TRUE
"cHRM" 0x6348524d LEVEL_END 0 NULL 0 TRUE

sRGB Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"sRGB" 0x73524742 VALUE_ITEM UINT32   1 FALSE

ICC profile Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"iCCP" 0x70485973 LEVEL_START 0 NULL 0 TRUE
"ProfileName" 0x70485973 VALUE_ITEM STRING   Variable FALSE
"ProfileData" 0x70485973 VALUE_ITEM RAW_DATA   Variable FALSE
"iCCP" 0x70485973 LEVEL_END 0 NULL 0 TRUE

Background Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"bKGD" 0x624b4744 VALUE_ITEM UINT8 or UINT16   Variable FALSE

Significant Bits Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"sBIT" 0x73424954 VALUE_ITEM UINT8   Variable FALSE

Suggested Palette Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"sPLT" 0x73504c54 LEVEL_START 0 NULL 0 TRUE
"PaletteName" 0x73504c54 VALUE_ITEM STRING   Variable TRUE
"SampleDepth" 0x73504c54 VALUE_ITEM UINT8   1 FALSE
"PaletteEntryCount" 0x73504c54 VALUE_ITEM UINT16 <N> 1 FALSE
Palette entry level 0
...
Palette entry level n
"sPLT" 0x70485973 LEVEL_END 0 NULL 1 FALSE
Palette Entry Level
Name Id Type Value Type Value Value Length Read Only
"PaletteEntry" <Entry No.> LEVEL_START 0 NULL 0 TRUE
"Red" <Entry No.> VALUE_ITEM UINT8 or UINT16   1 FALSE
"Green" <Entry No.> VALUE_ITEM UINT8 or UINT16   1 FALSE
"Blue" <Entry No.> VALUE_ITEM UINT8 or UINT16   1 FALSE
"Alpha" <Entry No.> VALUE_ITEM UINT8 or UINT16   1 FALSE
"Frequency" <Entry No.> VALUE_ITEM UINT16   1 FALSE
"PaletteEntry" <Entry No.> LEVEL_END 0 NULL 0 TRUE

Palette Histogram Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"hIST" 0x68495354 VALUE_ITEM UINT16   Variable FALSE

Modified Time Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"tIME" 0x74494d45 LEVEL_START 0 NULL 0 TRUE
"Year" 0x74494d45 VALUE_ITEM UINT16   1 FALSE
"Month" 0x74494d45 VALUE_ITEM UINT8   1 FALSE
"Day" 0x74494d45 VALUE_ITEM UINT8   1 FALSE
"Hour" 0x74494d45 VALUE_ITEM UINT8   1 FALSE
"Minute" 0x74494d45 VALUE_ITEM UINT8   1 FALSE
"Second" 0x74494d45 VALUE_ITEM UINT8   1 FALSE
"tIME" 0x74494d45 LEVEL_END 0 NULL 0 TRUE

Text Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"tEXt" 0x74455874 LEVEL_START 0 NULL 0 TRUE
"Keyword" 0x74455874 VALUE_ITEM STRING   Variable FALSE
"Text" 0x74455874 VALUE_ITEM STRING   Variable FALSE
"tEXt" 0x74455874 LEVEL_END 0 NULL 0 TRUE

Compressed Textual Data Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"zTXt" 0x7a545874 LEVEL_START 0 NULL 0 TRUE
"Keyword" 0x7a545874 VALUE_ITEM STRING   Variable FALSE
"CompressionMethod" 0x7a545874 VALUE_ITEM UINT8   1 FALSE
"Text" 0x7a545874 VALUE_ITEM STRING   Variable FALSE
"zTXt" 0x7a545874 LEVEL_END 0 NULL 0 TRUE

International Textual Data Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"zTXt" 0x69545874 LEVEL_START 0 NULL 0 TRUE
"Keyword" 0x69545874 VALUE_ITEM STRING   Variable FALSE
"CompressionFlag" 0x69545874 VALUE_ITEM BOOL      
"CompressionMethod" 0x69545874 VALUE_ITEM UINT8   1 FALSE
"LanguageTag" 0x69545874 VALUE_ITEM STRING      
"TranslatedKeyword" 0x69545874 VALUE_ITEM RAW_DATA      
"Text" 0x69545874 VALUE_ITEM RAW_DATA   Variable FALSE
"zTXt" 0x69545874 LEVEL_END 0 NULL 0 TRUE

Calibration of Pixel Values Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"pCAL" 0x7043414c LEVEL_START 0 NULL 0 TRUE
"CalibrationName" 0x7043414c VALUE_ITEM STRING   Variable FALSE
"OriginalZero(x0)" 0x7043414c VALUE_ITEM INT32   1 FALSE
"OriginalMax(x1)" 0x7043414c VALUE_ITEM INT32   1 FALSE
"EquationType" 0x7043414c VALUE_ITEM UINT8   1 FALSE
"NumberOfParameters" 0x7043414c VALUE_ITEM UINT8 <N> Variable FALSE
"UnitName" 0x7043414c VALUE_ITEM STRING   Variable FALSE
"CalibrationParameter" 0 VALUE_ITEM STRING   Variable FALSE
...
"CalibrationParameter" <N> - 1 VALUE_ITEM STRING   Variable FALSE
"pCAL" 0x7043414c LEVEL_END 0 NULL 0 TRUE

Physical Scale Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"sCAL" 0x7343414c LEVEL_START 0 NULL 0 TRUE
"UnitSpecifier" 0x7343414c VALUE_ITEM UINT8   1 FALSE
"PixelWidth" 0x7343414c VALUE_ITEM STRING   Variable FALSE
"PixelHeigt" 0x7343414c VALUE_ITEM STRING   Variable FALSE
"sCAL" 0x7343414c LEVEL_END 0 NULL 0 TRUE

GIF Application Extension Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"gIFx" 0x67494678 LEVEL_START 0 NULL 0 TRUE
"ApplicationIdentifier" 0x67494678 VALUE_ITEM STRING   Variable FALSE
"AuthenticationCode" 0x67494678 VALUE_ITEM UINT8   1 FALSE
"ApplicationData" 0x67494678 VALUE_ITEM RAW_DATA   Variable FALSE
"gIFx" 0x67494678 LEVEL_END 0 NULL 0 TRUE

GIF Graphic Control Extension Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"gIFg" 0x67494674 LEVEL_START 0 NULL 0 TRUE
"DisposalMethod" 0x67494674 VALUE_ITEM UINT8   1 FALSE
"UserInputFlag" 0x67494674 VALUE_ITEM UINT8   1 FALSE
"DelayTime" 0x67494674 VALUE_ITEM UINT16   1 FALSE
"gIFg" 0x67494674 LEVEL_END 0 NULL 0 TRUE

Image Offset Chunk Metadata

Name Id Type Value Type Value Value Length Read Only
"oFFs" 0x6f464673 LEVEL_START 0 NULL 0 TRUE
"XPosition" 0x6f464673 VALUE_ITEM UINT32   1 FALSE
"YPosition" 0x6f464673 VALUE_ITEM UINT32   1 FALSE
"UnitSpecifier" 0x6f464673 VALUE_ITEM UINT8   1 FALSE
"oFFs" 0x6f464673 LEVEL_END 0 NULL 0 TRUE

The Rest Chunk Metadata

The rest chunk data are passed as raw data

Name Id Type Value Type Value Value Length Read Only
<Chunk Name> <Chunk ID> VALUE_ITEM RAW_DATA Variable FALSE

<Chunk Name> is a string representation of the chunk type value.

<Chunk ID> is a binary representation of the chunk type value.

Callback Required for Writing PNG Metadata Items

Value of these metadata items can be changed using LPAFT_IG_METAD_ITEM_SET_CB callback only:

Item Name Item Id
Physical dimension chunk metadata
"XAxis" 0x70485973
"YAxis" 0x70485973
"UnitSpecifier" 0x70485973

The rest of the PNG metadata items can be written using LPAFT_IG_METAD_ITEM_ADD_CB callback only.

PNG Metadata ID Constants

Please see enumIGPNGTagIDs for the complete list of PNG Metadata Item Id constants.