Documentation/Reference

Native image format profiles

All production codecs are BASIL source. These profiles describe implemented behavior, not universal support for every variant of a format. Exact signatures and limit defaults are in the API reference .

Format Reading Writing
PNG Standard color types/bit depths, palette/transparency, filters, Adam7 interlace; CRC and bounded zlib decoding RGBA8, lossless
BMP Selected uncompressed 24/32-bit and supported mask profiles V5 RGBA with alpha
JPEG 8-bit Huffman sequential and progressive; supported grayscale/YCbCr scan arrangements, subsampling and restart intervals Baseline grayscale or 4:4:4 color, quality selection; explicit background for transparent input
GIF GIF87a/89a palettes, interlace, transparency, LZW, bounded rectangles, disposal and loop metadata Palette quantization, transparency, LZW, still and animation
APNG Coalesced frames with rational delays, offsets, blending and disposal PNG/APNG animation with explicit frame timing
WebP VP8 lossy, VP8L lossless, supported alpha and animation containers Lossless VP8L, still and animation

Use CanEncodeImage/CanDecodeImage and animation capability queries for format-level availability. AVIF/TIFF enum values are reserved and return false; unsupported profiles raise CanvasError. No lossy WebP writer, progressive JPEG writer, arithmetic/lossless/hierarchical/CMYK JPEG, color management, HDR, EXIF orientation processing or metadata-preserving editor is claimed.

DecodeImage checks signatures. Its still-image APIs reject animation rather than silently throwing away frames; use DecodeAnimation/LoadAnimation for GIF/APNG/animated WebP. An ordinary still image can become a one-frame animation with zero delay. EncodeImage defaults to PNG; EncodeAnimation defaults to APNG. Save APIs infer supported extensions when the format is Auto. Encoding finishes before atomic file replacement.

Animation owns coalesced RGBA8 snapshots. AppendAnimationFrame borrows its Canvas and stores an independent snapshot. AnimationFrame returns a fresh Canvas. Delays retain their numerator/denominator; AnimationFrameDelay exposes a rounded typed Duration. Zero delay is valid. There is no implicit playback task or display thread. Play-count interpretation is normalized by the container adapters. DrawAnimationFrame composites a frame without first cloning it.

The default canvas pixel limit is 16,777,216; dimensions allow configurable limits up to 67,108,864 pixels, with overflow checks before multiplication/allocation. Generic encoded input defaults to 64 MiB. Animation decoding defaults to 1,000 frames and 256 MiB decoded/work storage; retained animations permit at most 10,000 frames. Codec-specific plane, coefficient and dictionary budgets are checked separately. Large padded JPEG MCU planes count toward its work limit. These limits exclude some allocator capacity and caller-owned input, and are not a promise about peak process RSS.

From the BASIL documentation. View source ↗

Find your way around BASIL

Type to search the manual.