Import with #import "std/jpeg".

WriteJPEG :: (image: *Image, output: *Vec(u8), quality: s32) -> bool

Appends IMAGE as a baseline JPEG at QUALITY (1 to 100) to OUTPUT.

ReadJPEG :: (bytes: []u8) -> Image

Decodes a baseline or progressive JPEG file's bytes (1-channel greyscale or 3-channel YCbCr with any standard chroma subsampling) into an Image. Returns an invalid Image (see ImageValid) when BYTES is not a supported JPEG.

Source ↗ · All modules