ImageInfo
What a file says about itself, read from its header alone: no pixel decode, no multi-megabyte allocation. This is what you want for laying out a grid before the images arrive, rejecting an upload that's 20000 px wide, or deciding whether a decoder should claim a file at all.
val info = ImageKodec.probe(bytes)
if (info.width.toLong() * info.height > budget) reject()
grid.reserve(info.displayWidth, info.displayHeight) // orientation appliedCost is proportional to the header, not the image: a few hundred bytes for PNG/JPEG/BMP/TIFF/WebP. GIF walks frame descriptors while skipping compressed sub-blocks. APNG reports the frame count declared by acTL; only animation decoding validates that the complete frame sequence matches that declaration.
Constructors
Properties
The colour channels the image decodes to, known from the header before any decode: 1 for gray, 3 for colour (RGB or YCbCr), 4 for CMYK or YCCK, whose ink a decode converts, and 0 where the format cannot say from its header. A palette counts as the colours it holds. For a JPEG 2000 image it follows the colour boxes (colr, pclr, cmap, cdef, ITU-T T.800 I.5.3), so it agrees with what the decoder gives, and a renderer can fix an image's colour space when a page loads without decoding it (#119).
what the file declares about its color space (an embedded ICC profile, and PNG's sRGB, gamma, chromaticity and cICP chunks), or null when it declares nothing. A decode applies it only when its colorTarget asks; without one, decoded samples are the file's own.
height after orientation is applied.
width after orientation is applied: what the user will actually see.
the container, same value ImageKodec.detect returns
number of animation frames; 1 for stills, and 1 for every page of a TIFF, whose pages are separate images rather than frames
the file declares an alpha channel or transparency. This is what the container says, not a pixel scan: an RGBA PNG whose pixels are all opaque still reports true. Use KiteBitmap.hasTransparency for the truth.
stored pixel height, before orientation
True when frameCount> 1.
whether this build's ImageKodec.decode can actually produce pixels for this file. False means the format or a specific feature isn't implemented; unsupportedReason names it. It is also false for WebP data that ends before its first image chunk, because nothing yet says what the image holds.
the EXIF orientation, Orientation.Normal when absent
number of pages: every image file directory in a TIFF's main chain, every top-level image of a HEIC or AVIF file (its images that are no thumbnail, auxiliary image, tile or other alternative of the primary, the primary first), and 1 for every other format. The other fields describe the page that was probed, the first unless ImageKodec.probePage asked for another.
The page of the left-eye image of a stereo pair, such as a spatial photo, or -1: a HEIF file's ster entity group names its two images, and each is a page (#168).
The page of the right-eye image of a stereo pair, or -1. See stereoLeftPage.
See thumbnailWidth.
The size of the largest thumbnail the file carries, or 0 by 0 for none: the thmb items of a HEIC or AVIF file, or the thumbnail in the EXIF of a JPEG. ImageKodec.decodeThumbnail decodes one (#150).
human-readable reason when isDecodable is false
stored pixel width, before orientation