OptionalapplyWhether to convert the colors of images with an embedded ICC profile (PNG, JPEG, WebP, AVIF, JPEG XL, TIFF), and
of AVIFs with other color primaries than sRGB's (Display P3, BT.2020), to sRGB, like browsers show them: wide
gamut photos (Display P3 from phones, Adobe RGB, ProPhoto) look as intended instead of washed out. Matrix/TRC
profiles (RGB and gray) are applied, relative colorimetric (colors outside sRGB are clipped); profiles with only
lookup tables, CMYK ones and ones that are sRGB anyway leave the pixels as they are. Default: true
OptionalapplyWhether to rotate/mirror JPEGs, TIFFs, PNGs and WebPs as their orientation tag (Exif or XMP) says. Default: true
OptionalmaxThe most pixels to decode: larger images throw a RangeError before anything that size is allocated, so small
files declaring huge images (decompression bombs) can't exhaust the memory. Default: 268402689 (16383², like
sharp), Infinity for no limit
OptionalthreadsAt most this many worker threads decode in parallel (lossy JPEG XLs from 4 megapixels on, one per 2 megapixels
at most, lossless ones from 1.5 megapixels and 512 KiB on; AVIFs from 4 megapixels on: the conversion to RGB,
one per megapixel, and the tiles of grids), 1 for none. Default: the processors available, at most 8 (1 where
workers can't share memory)
OptionaltoneHow Radiance HDRs, PFMs and HDR (PQ or HLG) AVIFs and JPEG XLs, whose light can be brighter than (SDR) white,
become 8 bit sRGB: 'reinhard' compresses the brightest parts like Reinhard's tone mapping operator does (the
brightest pixel becomes white, images no brighter than white stay as they are), 'clamp' clamps everything
brighter than white. Default: 'reinhard'
Options of Image.decode