ImageGear PDF v25.1 - Updated
GIF Metadata Structure
User Guide > File Formats and Compressions > File Formats > Metadata Structures > GIF Metadata Structure

GIF file format is complex and has different non-image data that can be stored before and after an image data. The GIF metadata design allows you to read/write any GIF non-image data and prevents from misunderstanding with GIF extensions storing order.

The following metadata are always saved before an image data:

All other GIF Extensions Metadata are saved before an image data.

ImageGear represents simpler GIF metadata by single metadata items, and more complex metadata by subtrees. Thus, there are two main GIF metadata levels in ImageGear:

This section provides information about the following:

GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
GIF header level
GIF Logical Screen Descriptor level
GIF Image Descriptor level
optional Global and/or Local Color Tables and

optional GIF Extensions levels (extensions before image)

GIF Header Metadata GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
"GIFHeader" 0x10 Tree 0 NULL 0 TRUE

GIF Header Level

Name Id Type Value Type Value Value Length Read Only
"Signature" 0x101 Leaf STRING "GIF" 3 TRUE
"Version" 0x102 Leaf STRING   3 TRUE

GIF Logical Screen Descriptor Metadata GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
"LogicalScreenDescriptor" 0x20 Tree        

GIF Logical Screen Descriptor Level

Name Id Type Value Type Value Value Length Read Only
"LogicalScreenWidth" 0x201 Leaf UINT16   1 FALSE
"LogicalScreenHeight" 0x202 Leaf UINT16   1 FALSE
 
"Fields" 0x205 Tree        
"GlobalColorTableFlag" 0x206 Leaf BOOL   1 FALSE
"ColorResolution" 0x207 Leaf UINT8   1 FALSE
"SortFlag" 0x208 Leaf BOOL   1 FALSE
"GlobalColorTableSize" 0x209 Leaf UINT8   1 FALSE
"Fields" 0x205 Tree        
 
"BackgroundColorIndex" 0x203 Leaf UINT8     FALSE
"PixelAspectRatio" 0x204 Leaf UINT8     FALSE

GIF Global Color Table Metadata

Name Id Type Value Type Value Value Length Read Only
"GlobalColorTable" 0x30 Leaf RAW_DATA   Variable TRUE

GIF Image Descriptor Metadata GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
"ImageDescriptor" 0x2C Tree        

GIF Image Descriptor Level

Name Id Type Value Type Value Value Length Read Only
"ImageLeftPosition" 0x2C1 Leaf UINT16   1 FALSE
"ImageTopPosition" 0x2C2 Leaf UINT16   1 FALSE
"ImageWidth" 0x2C3 Leaf     1 FALSE
"ImageHeight" 0x2C4 Leaf     1 FALSE
"Fields" 0x2C5 Tree        

GIF Image Descriptor Fields Level

Name Id Type Value Type Value Value Length Read Only
"LocalColorTableFlag" 0x2C6 Leaf BOOL   1 FALSE
"InterlaceFlag" 0x2C7 Leaf BOOL   1 FALSE
"SortFlag" 0x2C8 Leaf BOOL   1 FALSE
"LocalColorTableSize" 0x2C9 Leaf UINT8   1 FALSE

GIF Local Color Table Metadata

Name Id Type Value Type Value Value Length Read Only
"LocalColorTable" 0x40 Leaf RAW_DATA   Variable TRUE

GIF Extensions Metadata GIF Graphic Control Extension Metadata

GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
"GraphicControlExtension" 0xF9 Tree        

GIF Graphic Control Extension Level

Name Id Type Value Type Value Value Length Read Only
"Fields" 0xF91 Tree        
"DisposalMethod" 0xF92 Leaf UINT8   1 FALSE
"UserInputFlag" 0xF93 Leaf BOOL   1 FALSE
"TransparentColorFlag" 0xF94 Leaf BOOL   1 FALSE
"Fields" 0xF91 Tree        
 
"DelayTime" 0xF95 Leaf UINT16   1 FALSE
"TransparentColorIndex" 0xF96 Leaf UINT8   1 FALSE

GIF Comment Extension Metadata

Name Id Type Value Type Value Value Length Read Only
"CommentExtension" 0xFE Leaf STRING   Variable TRUE

GIF Application Extension Metadata GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
"ApplicationExtension" 0xFF Tree        

GIF Application Extension Level

Name Id Type Value Type Value Value Length Read Only
"ApplicationIdentifier" 0xFF1 Leaf STRING   8 FALSE
"Appl.AuthenticationCode" 0xFF2 Leaf UINT8   4 FALSE
"ApplicationData" 0xFF3 Leaf RAW_DATA   Variable FALSE

GIF Plain Text Extension Metadata GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
"PlainTextExtension" 0x01 Tree 0 NULL 0 TRUE

GIF Plain Text Extension Level

Name Id Type Value Type Value Value Length Read Only
"TextGridLeftPosition" 0x11 Leaf UINT16   1 FALSE
"TextGridTopPosition" 0x12 Leaf UINT16   1 FALSE
"TextGridWidth" 0x13 Leaf UINT16   1 FALSE
"TextGridHeight" 0x14 Leaf UINT16   1 FALSE
"CharacterCellWidth" 0x15 Leaf UINT8   1 FALSE
"CharacterCellHeight" 0x16 Leaf UINT8   1 FALSE
"TextForegroundColorIndex" 0x17 Leaf UINT8   1 FALSE
"TextBackgroundColorIndex" 0x18 Leaf UINT8   1 FALSE
"PlainTextData" 0x19 Leaf STRING   Variable FALSE

GIF Extensions After Image Metadata GIF Metadata Level

Name Id Type Value Type Value Value Length Read Only
"AfterImageExtensions" 0xFFF Tree        

GIF Extensions After Image Level

Name Id Type Value Type Value Value Length Read Only
One or more GIF extension levels