Skip to content
FutureBlitz

    Install

    Import std.image.gif

    Gif

    std.image.gif

    struct

    Public Struct Gif

    What reads and writes GIF images and animations, in its Static Methods.

    Examples

    Local image = Image(4, 4)
    image.Fill(Color32.Lime)
    Local back = Try Gif.Decode(Gif.Encode(image))
    Expect(back.Width == 4 && back[3, 3] == Color32.Lime)

    std/image/gif.fb, line 26

    • @PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): Image Throws IOError static method #

      The first frame of the GIF in data. Throws an IOError of INVALID_DATA when the data isn't a GIF or is broken, and OTHER when the frame has more pixels than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method DecodeAnimation(data: UInt8[], limit: Int = MOST_PIXELS): Animation Throws IOError static method #

      The frames of the GIF in data, each as it's shown once the frames before it are, its delay in hundredths of a second as milliseconds, and how many times they play, by the NETSCAPE2.0 extension, which counts the times after the first, or once without it. Throws an IOError as Decode does, of OTHER when the frames, all their pixels counted, have more than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method Encode(image: Image): UInt8[] static method #

      The GIF of the image, one frame. Panics when it has no pixels or a side longer than 65535.

    • @PanicsAtCaller Public Static Method EncodeAnimation(animation: Animation): UInt8[] static method #

      The GIF of the animation's frames, each delay in hundredths of a second, rounded, and each frame drawn on a transparent canvas. Panics when the animation has no frames, no pixels, a side longer than 65535, a frame whose image isn't its size, or one longer than 655350 milliseconds, or plays more than 65536 times, which GIF can't count.

    Report an issue with this page or with FutureBlitz on GitHub.