Companion

Holds the factories that decode image files.

Functions

Link copied to clipboard
fun decode(bytes: ByteArray): Image

Decodes a PNG or JPEG file held in bytes into a new image. Images with fewer channels are expanded to RGBA, with opaque alpha when the file has none.

Link copied to clipboard

Decodes a PNG or JPEG file held in bytes into a new image, or returns null when bytes is empty, is not a PNG or JPEG file, or is corrupt. Images with fewer channels are expanded to RGBA, with opaque alpha when the file has none.