Import with #import "std/png_linux".

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

The picture a whole PNG file's bytes hold; an invalid Image (see ImageValid) when they are not a PNG this reads.

WritePNG :: (image: *Image, output: *Vec(u8), alpha: bool, level: s32) -> bool

Encodes IMAGE as RGBA, or as RGB when ALPHA is false, appending the file's bytes to OUTPUT.

WriteIndexedPNG :: (image: *IndexedImage, output: *Vec(u8), level: s32) -> bool

Encodes a palette picture with 8-bit indices, appending the file's bytes to OUTPUT.

ReadPNGFile :: (path: string) -> Image

The picture in a PNG file; invalid when it cannot be read.

WritePNGFile :: (path: string, image: *Image, alpha: bool) -> bool
WriteIndexedPNGFile :: (path: string, image: *IndexedImage) -> bool

Source ↗ · All modules