decode
Decode data into a KiteBitmap, sniffing the format first. GIF and WebP inputs yield their first composited frame. APNG yields its default image, which may be separate from the animation; use decodeAnimation for the full sequence. A TIFF yields its first page; ImageInfo.pageCount says how many there are and decodePage decodes them.
With applyOrientation the EXIF orientation tag is honoured, so a phone photo comes back the way it was shot instead of on its side. It defaults to false because it changes the returned dimensions, and a caller that already handles orientation itself should not pay for it twice: check ImageInfo.orientation from probe if you want to decide per file.
With colorTarget ColorTarget.Srgb the colours are converted to sRGB through the file's embedded profile, as a browser draws them; by default they come back as stored.
cancellationCheck, when given, runs at a coarse step of the decode and may throw to stop a decode whose result no longer matters; what it throws comes out of this call as it is. It runs once a row of MCUs of a JPEG, every 64 rows and every DEFLATE block of a PNG, before each strip or tile of a TIFF, each tile and code block of a JPEG 2000 image, each row of superblocks of an AVIF, each group of a JPEG XL frame and each row of macroblocks of a JPEG XR image; the other formats check it once before they start.
Throws
on malformed/truncated input or unknown format
on formats recognised but not yet decodable (see ImageFormat: sniffing is deliberately wider than decoding)