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.
-
@PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): Image Throws IOErrorstatic method #The image in
data, which is a JPEG, each pixel opaque. Throws an IOError of INVALID_DATA when thedataisn't a JPEG or is broken, and OTHER when the image has more pixels thanlimit. Panics when thelimitis negative. -
@PanicsAtCaller Public Static Method Encode(image: Image, quality: Int = 90): UInt8[]static method #The JPEG of the
image's colors, atquality, from 1 to 100, its alpha left out. Panics when thequalityis another, or theimagehas no pixels or a side longer than 65535.
Report an issue with this page or with FutureBlitz on GitHub.