Skip to content
FutureBlitz

    Install

    Import std.image.jpeg

    std.image.jpeg

    JPEG: Jpeg.Decode reads baseline and progressive JPEGs, gray, YCbCr, and CMYK, as stb_image reads them, and Encode writes a baseline one at a quality, as stb_image_write does, without the image's alpha, which JPEG doesn't have.

    std/image/jpeg.fb

    Types

    Jpeg struct

    Public Struct Jpeg

    What reads and writes JPEG images, in its Static Methods.

    std/image/jpeg.fb, line 10

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

      The image in data, which is a JPEG, each pixel opaque. Throws an IOError of INVALID_DATA when the data isn't a JPEG or is broken, and OTHER when the image has more pixels than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method Encode(image: Image, quality: Int = 90): UInt8[] static method #

      The JPEG of the image's colors, at quality, from 1 to 100, its alpha left out. Panics when the quality is another, or the image has no pixels or a side longer than 65535.

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