module

CrImage::GIF

GIF module implements a GIF image decoder and encoder. The GIF specification is at https://www.w3.org/Graphics/GIF/spec-gif89a.txt

Constants

APPLICATION_EXTENSION = 255_u8
BLOCK_TERMINATOR = 0_u8
COMMENT_LABEL = 254_u8
EXTENSION_INTRODUCER = 33_u8

GIF block types

GIF_HEADER_87A = "GIF87a".to_slice
GIF_HEADER_89A = "GIF89a".to_slice
GRAPHIC_CONTROL_LABEL = 249_u8

Extension labels

IMAGE_SEPARATOR = 44_u8
PLAIN_TEXT_LABEL = 1_u8
TRAILER = 59_u8

Class methods

read(path : String) : CrImage::Image

read and decode the entire image (first frame for animated GIFs)

Source
read(io : IO) : CrImage::Image
Source
read_animation(path : String) : Animation

read all frames from an animated GIF

Source
read_animation(io : IO) : Animation
Source
read_config(path : String) : CrImage::Config

read and decode the configurations like color model, dimensions

Source
read_config(io : IO) : CrImage::Config
Source
write(path : String, image : CrImage::Image, transparent_index : Int32 | Nil = nil) : Nil

write the Image to file in GIF format

Source
write(io : IO, image : CrImage::Image, transparent_index : Int32 | Nil = nil) : Nil

write the Image to IO in GIF format

Source
write_animation(path : String, animation : Animation) : Nil

write an animated GIF to file

Source
write_animation(io : IO, animation : Animation) : Nil
Source

Nested types