Codec support

Supported codec subsets and current limitations.

The matrix distinguishes decode, encode, metadata, animation, and memory support. A recognized format may still contain an unsupported coding mode.

10 codecs5 output formatsExplicit unsupported errors

At a glance

The current reference implementations are first-party strict TypeScript and never runtime-import native libraries, WASM modules, browsers, or system tools. Future WASM codec providers and WebGPU compute providers will use explicit opt-in imports and registration; the TypeScript codecs remain the default implementations and portable fallbacks.

CodecDecodeEncodePrimary boundary
JPEG● Yes● YesStatic 8-bit Huffman JPEG, including AVI1/MJPEG frames with omitted standard tables; no arithmetic, lossless, 12-bit, or omitted nonstandard external tables
PNG● Yes● YesNo APNG frame decode or indexed/16-bit output
WebP● Yes● YesStatic images only; compressed RIFF input and compact VP8L transform maps remain source-sized
BMP● Yes● YesCommon Windows and OS/2 raster subsets; no embedded JPEG or PNG
TIFF● Yes● YesBroad validated IFD-graph and strip/tile decode plus public TIFF document, native scientific-raster, GeoTIFF, OME-TIFF, deterministic profile, whole-slide, and bounded HTTP-range access APIs; structured strip, tile, Classic TIFF, BigTIFF, multi-page, and SubIFD-pyramid RGB/RGBA output; no implicit display conversion for arbitrary scientific multiband data, general CMYK ICC profile classes, multi-area vendor slide composition, or alternate compression encode profiles
GIF● Static / explicit frame 0— NoStatic images decode directly; animated inputs require explicit frame 0 selection; no animation editing or GIF output
ICO● Yes— NoStatic ICO decode only; no CUR or ICO output
JPEG 2000 / JP2● Limited— NoStatic Part 1 JP2 subset; current decoder is a full-frame fallback
AVIF● Limited— NoRestricted 8-bit monochrome, YUV 4:2:0, YUV 4:2:2, and YUV 4:4:4 still-image decode with compatible integer clean-aperture cropping, skipped and residual intra-block copy, compatible lossy multi-tile frames with full post-filtering, compatible non-reduced sequence headers and shown key-frame headers with contiguous tile-group OBUs, single-tile AV1 super-resolution including filtered frames, and explicit spatial-layer selection from multi-frame items when the selected layer is an independently decodable shown key frame; coded-lossless 10-bit and 12-bit YUV 4:2:0 and YUV 4:4:4 decode including compatible YUV 4:4:4 multi-tile frames; filter-free lossy 10-bit and 12-bit YUV 4:2:0, YUV 4:2:2, and YUV 4:4:4 decode; lossy 10-bit YUV 4:4:4 decode with compatible deblocking, CDEF, and Wiener restoration; compatible alpha auxiliaries; opaque grids; compatible sRGB, linear and extended-sRGB, linear BT.2020 NCLX, and RGB matrix/TRC ICC conversion; and compatible same-size, single-channel ISO gain maps for HDR-to-SDR output
HEIF / HEIC (experimental)● Experimental— NoExperimental opt-in common intra-only HEVC still subsets; excluded from the default allCodecs set; no auxiliary alpha or encoding
Detection is separate from support. Recognizable PDF, SVG, CUR, JPEG XL, or unregistered codec input gets a specific error instead of being mistaken for unknown bytes.
Experimental HEIF/HEIC. This decoder is excluded from allCodecs and requires the direct purejsimage/codecs/experimental/heic import. HEIC commonly carries HEVC/H.265 data that may be subject to third-party patent rights. The MIT license grants no third-party patent rights; users and distributors must assess their own licensing obligations.

Codec details

JPEG

Decode + encode

Decodes common 8-bit baseline, extended-sequential, multi-scan, and progressive grayscale, YCbCr, RGB, CMYK, and YCCK JPEGs with chroma-aware interpolation, plus AVI1/MJPEG baseline frames that use omitted standard Huffman tables. Encodes baseline and scan-optimized refinement-based progressive JPEG with configurable quality, chroma sampling, native grayscale, and restart markers.

Full JPEG checklist →

PNG

Decode + encode

Decodes every legal grayscale, truecolor, indexed, and alpha combination at 1-16 bits, including Adam7, palettes, transparency, and supported color profiles. Encodes streaming 8-bit grayscale, RGB, or RGBA PNG with adaptive filters and opt-in EXIF and compatible ICC preservation.

Full PNG checklist →

WebP

Decode + encode

Decodes static VP8 lossy, VP8L lossless, extended alpha, and odd RIFF padding. Encodes first-party static lossy, exact lossless, or near-lossless WebP with effort-based size optimization plus opt-in EXIF and compatible ICC preservation. Animation is detected and rejected for pixel decode.

Full WebP checklist →

BMP

Decode + encode

Decodes common Windows and OS/2 headers, indexed 1/4/8-bit pixels, RLE4/RLE8, RGB555/RGB565, top-down images, bitfields, and explicit alpha. Encodes 24-bit RGB and 32-bit RGBA BMP.

Full BMP checklist →

TIFF

Decode + encode

Decodes Classic TIFF and BigTIFF top-level frames and reduced-resolution SubIFDs across common display and scientific sample layouts. Supported compression includes first-party LERC/LERC-plus-Deflate, Zstandard, CCITT, JPEG, JPEG 2000, SGILog, and explicitly composed WebP in addition to TIFF baseline schemes. Public APIs expose bounded tag reads, native-precision N-channel rasters, GeoTIFF georeferencing and GDAL metadata, OME Z/C/T planes, deterministic vendor profiles, whole-slide region access, and validator-protected HTTP range reads. Structured document encoding writes Deflate-predicted RGB/RGBA strips or tiles as Classic TIFF or BigTIFF, including top-level pages and reduced-resolution SubIFD pyramids.

Full TIFF checklist →

GIF

Static / explicit frame 0 decode

Parses GIF87a/GIF89a, palettes, transparency, interlace, LZW data, frame rectangles, and static images. Metadata counts animation frames. Animated pixel decode fails unless frame 0 is explicitly selected; later frames and GIF encoding are unsupported.

Full GIF checklist →

ICO

Decode only

Decodes multi-image Windows icons backed by embedded PNG or common DIB pixels. Selection is deterministic; AND masks, partial alpha, and the legacy all-zero-alpha fallback are preserved.

Full ICO checklist →

JPEG 2000 / JP2

Limited decode

Decodes common static Part 1 JP2 grayscale and RGB images at 1-16 bits with reversible 5/3 or irreversible 9/7 wavelets, all five progression orders, multiple tiles, RCT/ICT, and enumerated grayscale, sRGB, or sYCC color.

Full JPEG 2000 / JP2 checklist →

AVIF

Limited decode

Metadata inspection covers a broad ISOBMFF and AVIF corpus. Pixel decode targets compatible static 8-bit monochrome and YUV 4:2:0, YUV 4:2:2, and YUV 4:4:4 images; coded-lossless 10-bit and 12-bit YUV 4:2:0 and YUV 4:4:4 images; filter-free lossy 10-bit and 12-bit YUV 4:2:0, YUV 4:2:2, and YUV 4:4:4 images; and lossy 10-bit YUV 4:4:4 images with compatible deblocking, CDEF, and Wiener restoration. Every supported high-depth path retains native samples through reconstruction and filtering before explicit RGBA conversion. The supported static path includes reduced still-picture sequences and compatible non-reduced sequences with one operating point, still_picture=0, and one shown key frame at maximum dimensions; complete compatible lossy 8-bit and coded-lossless high-depth multi-tile frames; contiguous tile-group OBUs; explicit lsel spatial-layer selection from a1lx-indexed multi-frame items when the selected frame is an independently decodable shown key frame in the selected a1op operating point; full-range monochrome alpha auxiliaries; opaque grids; integer clean-aperture cropping; palette screen content; skipped and residual intra-block copy; one-tile AV1 super-resolution; quantizer contexts 0-3 used by pinned fixtures; sRGB, linear and extended-sRGB, and linear BT.2020 NCLX conversion; compatible RGB matrix/TRC ICC conversion; same-size single-channel ISO gain-map composition for HDR-to-SDR output; documented in-loop filters; and the restricted Sharp/libaom quantization-matrix path. The avis sequence brand, dependent inter-frame enhancement layers, lsel=0xFFFF progressive output, show-existing-frame, decoder timing, frame IDs, dimension overrides, fractional clean apertures, multi-tile super-resolution, multi-tile intra-block-copy, partial or noncontiguous tile groups, grid alpha, gain-map grids, gain-map resampling, gain maps with alpha, broader NCLX or ICC conversion, filtered lossy 10-bit YUV 4:2:0 or 4:2:2, self-guided-restored lossy 10-bit frames, filtered lossy 12-bit frames, HDR output, broader AV1 syntax, and encoding remain unsupported and fail explicitly. PQ and HLG metadata remains inspectable, but pixel decode rejects both before SDR conversion unless a compatible SDR gain-map alternate is selected.

Full AVIF checklist →

HEIF / HEIC (experimental)

Experimental decode

Optional experimental decoder available only through the direct purejsimage/codecs/experimental/heic entry. Decodes common opaque Main, Main Still Picture, and selected Main 10 YUV 4:2:0 intra stills, direct images, and grid primaries. It is not registered by the default allCodecs set.

Full HEIF / HEIC (experimental) checklist →

Open the dedicated TIFF support guide for the complete decode, scientific, whole-slide, profile, output, and memory contract →

Memory classes

The public API is common, but codec structure determines the working set. “Supported” does not automatically mean “bounded independently of source dimensions.”

PathCurrent working model
JPEGIncremental entropy input, bounded MCU-row baseline output, restart-aware region seeking, and scaled IDCT; progressive decode and encode retain compact Int16 coefficient planes
PNGSequential scanlines and bounded output blocks; Adam7 retains compact requested samples
WebPVP8 uses two macroblock rows; VP8L uses a fixed maximum 4 MiB entropy history plus scanline transform buffers. Decode still retains compressed input and compact transform maps. Lossless encode retains one 32-bit transformed frame, a fixed maximum 4 MiB match table, and one encoded payload.
BMPRegion-based row reads; RLE uses compact full-frame index storage
TIFFSelected-frame, GeoTIFF, OME plane, and whole-slide region decode remain strip- or tile-bounded; IFD traversal and profile detection do not read unselected pixel segments. HTTP range reads use a bounded deduplicating LRU cache and reject resource changes. LERC, Zstandard, bit-order normalization, color conversion, prediction, raster/display output, and embedded codec pixels are bounded to the current metadata table or segment and emitted in bounded rows. JPEG 2000 reconstructs complete component state only for the current TIFF segment, not the source slide. Encoding retains compressed segment payloads until their offsets are known but never stages a full uncompressed frame.
GIFRetains compact first-frame palette indices, then emits bounded RGBA rows
ICODecodes one selected entry; DIB pixels are emitted in bounded rows
JPEG 2000 / JP2Current implementation retains full-frame component and output state
AVIFMetadata reads are bounded and all decoded RGBA is emitted in ordered 32-row blocks without a source-sized RGBA bitmap. Every decoder path enforces a 64 MiB aggregate coded-payload and conservatively estimated working-state limit. Compatible opaque, single-item, filter-free AV1 frames reconstruct through two-superblock YUV, prediction, palette, and coefficient-context rings, with finalized bands copied before reuse. Layered items retain unselected OBUs only as views into the bounded item payload; only the selected complete frame enters reconstruction, without OBU concatenation or copies. Compatible filter-free alpha auxiliaries with aligned orientation reconstruct through a synchronized second row ring. Compatible full-aperture 2x, 4x, and 8x resize input is box-filtered directly from bounded YUV rows before RGBA conversion. Integer clean-aperture regions convert only contributing samples, opaque grids retain one contributing tile row, CDEF uses delayed 8-row bands, and restoration retains deblocked stripe-boundary rows plus delayed 4-row output bands. Compatible filter-free single-tile super-resolution reuses bounded upscaled luma and chroma band buffers while retaining the source chroma halo across ring reuse. Filtered super-resolution, rotated-alpha, grid, and multi-tile paths retain padded full-frame YUV reconstruction state; filtered super-resolution additionally retains the upscaled YUV planes, and multi-tile working-set estimates account for one entropy and context allocation per tile.
HEIF / HEIC (experimental)Explicitly registered grid workflows decode requested tile rows; large compatible inputs remain explicitly measured

Choose an output

  • JPEG: Photographs and broadly compatible lossy output.
  • PNG: Exact alpha, screenshots, graphics, and lossless round trips.
  • WebP: Use effort 0 for faster lossless encoding or effort 6 for the smallest output. The first-party lossless encoder selects predictor, subtract-green, cross-color, palette, color-cache, LZ77, and spatial entropy coding without native dependencies.
  • BMP: Legacy Windows bitmap interoperability.
  • TIFF: Broad display-image input compatibility, native scientific and GeoTIFF raster access, validated OME and whole-slide pyramids, selective remote COG-style reads, explicit frame/pyramid selection, and structured Deflate RGB/RGBA strip, tile, BigTIFF, multi-page, and SubIFD-pyramid output.
Metadata is opt-in and format-specific. EXIF and ICC are stripped by default. JPEG, PNG, WebP, and HEIF/HEIC can read retained EXIF and compatible RGB ICC metadata; the selected output must support writing it. TIFF supports compatible ICC only. XMP and IPTC preservation are not implemented, and unsupported requests fail explicitly.

Planned formats

CUR and JPEG XL are not current codec entry points. The linked scope documents describe possible implementation subsets; they are not current capability claims or release commitments.

CUR scope · JPEG XL plan