Skip to main content

encode_gif

Function encode_gif 

Source
pub fn encode_gif(koi_frames: &[KoiFrame]) -> Result<Vec<u8>, GifEncodingError>
Expand description

Encode a seamless loop as an animated GIF at the static export size, repeating each native pixel in both dimensions. The GIF repeats forever at FRAMES_PER_SECOND; each delay, in hundredths of a second, is the step in a rounded running total, so a loop lasts exactly its frame count divided by the frame rate. Each frame stores only the box around its drawn pixels, with an exact palette of its colors, and that box clears before the next frame. Colors are never approximated: a frame with more than 255 colors or a partly transparent pixel fails instead. Identical frames produce identical bytes without I/O, timestamps, or input mutation.