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:

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
OptionIdAllowed ValuesUsage
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
FormatTImageFormat equivalentLoadingSaving
up to 256 colors indexed ifIndex8 YesYes
true color with transparency for animated frames ifA8R8G8B8 YesNo