# Graphics Interchange Format

# Graphics Interchange Format

GIF was (and is still used) popular format for storing images supporting multiple images per file and single color transparency. Pixel format is 8 bit indexed where each image frame can have its own color palette. GIF uses lossless LZW compression (patent expired few years ago). Imaging can load and save all GIFs with all frames and supports transparency.
Loadng of animated GIFs was rewritten in Imaging 0.26.2 (based on ExtraGIF mod by Sergey Galezdinov). It now supports two modes of operation:
- Raw Frames just extracts raw frames from GIF files without any modification. Useful when you want to do your own GIF animator. Extracted frames are all in ifIndex8.
- Animated Frames animates all frames using disposal methods and placement of frames onto logical screen. Correctly animates all tested GIFs (several thousand). Animated frames are in ifA8R8G8B8 format so even rare true color GIFs are supported (each frame has only 256 colors but you can place them side by side onto logical screen to create one larger true color image). This is the default mode.
You can select which mode you wan to use with ImagingGIFLoadAnimated option along with SetOption and GetOption functions. Or you can set them by modifying properties of TGIFFileFormat class.

## Options Related to GIF Files

OptionId | Allowed Values | Usage
--- | --- | ---
ImagingGIFLoadAnimated | 0 (false) or 1 (true) | Boolean option that specifies whether GIF images with more frames are animated by Imaging (according to frame disposal methods) or just raw frames are loaded and sent to user (if you want to animate GIF yourself). Default value is 1 (true).

## GIF File Format Support

Format | TImageFormat equivalent | Loading | Saving
--- | --- | --- | ---
up to 256 colors indexed | ifIndex8 | Yes | Yes
true color with transparency for animated frames | ifA8R8G8B8 | Yes | No