Skip to content

Images: comparison ​

The capstone of the images catalog. It reads the 58 deep-dives side by side along the ten dimensions of the analysis spine, states what nearly every mature subject does, names the real forks and who took which side, collects the evidence for each of the nine questions, and maps every capability the field has to where Sparkles stands in its baseline. The design decision this catalog feeds (one sparkles:image package or a split into image-core, image-formats and image-algorithms; mir's Slice or an own view type) is not made here: this page presents evidence and trade-offs only.

Last reviewed: November 7, 2026

NOTE

Every row and claim cites the deep-dive section that supports it. "Verified" means the deep-dive compiled or ran something and reports the result; "documented" means it read the claim in source or official documentation. Where this page counts subjects ("most", "nearly every"), the count is over the 30 Tier A subjects in At a glance unless it says otherwise. Terms such as stride, view and suspendable decoding are defined once in Concepts.

At a glance ​

One row per Tier A subject, in the order of the master catalog. The labels are normalised so that a column can be scanned: "auto" is compiler auto-vectorisation with no dispatch layer; "per-ISA + runtime" is hand-written intrinsics per instruction set chosen at run time; "portable + runtime" is one vector source compiled per target and chosen at run time; "delegated" means the SIMD lives in a wrapped dependency; "caller-set" limits are values a caller can change per decode, "fixed caps" are compiled in, "process-global" are set once per process.

SubjectEcosystemPixel modelGenericityDecode shapeLimitsSIMDGPUColour
mir-algorithmDN-D strided, element strides, kind in typetemplates + structural constraintsn/anoneautononenone
dcvDN-D Slice, channel as trailing axistemplates over Slicepull, whole (delegated)none (inherited)auto (LDC only)nonenone
colorDone element, no imagetemplates + string mixinsn/an/anonenoneclosed RGB enum + CIE spaces
ae.utils.graphicsDinterleaved 2-D lazy viewdesign by introspectionpush (libpng), wholenoneautononenone
Boost.GILC++interleaved/planar/packed 2-D, byte stridestemplates + opt-in conceptspull, wholenonenonenonetags only
VIGRAC++N-D strided, element stridestemplates + trait classespull, wholenoneautononeelement type
HalideC++ DSLN-D strided, per-axis min/extent/strideDSL; runtime tag at ABIn/agenerated checks, 2^31 Bcompiler, runtime-selectedmultiplenone
JuliaImagesJuliaN-D array of colour structsmultiple dispatchpull, wholenoneautononeelement type
ITKC++N-D dense, no strides, physical geometrytemplates inside, virtual outsidepull, regionnoneautoOpenCL (optional)none
OpenCVC++runtime-typed N-D, byte stepsruntime type codespull, wholeprocess-globalportable + runtimemultiplenone (convention)
ImageSharpC#interleaved 2-D, row-aligned buffer groupsconstrained genericspull, wholeallocator capsper-ISA + portable tiernoneCICP + ICC metadata, typed alpha
libvipsCstrided regions, runtime band formatGObject introspectiondemand-driven region pullblock lists + per-loaderportable + runtimenoneICC (lcms2) + CICP
OpenImageIOC++runtime-typed interleaved, byte stridesruntime TypeDesc + pluginspull, random accessprocess-globalcompile-time wrappernoneOCIO + CICP + ICC bytes
image-rsRustinterleaved packed 2-D, no stridesealed traits + closed enumpull, wholecaller-setdelegatednoneCICP
zune-imageRustplanar dense (image), interleaved (codecs)traits + runtime depth tagpull, retry (JPEG only)per-axis + per-formatper-ISA + runtimenoneCICP vocabulary, CMS delegated
SkiaC++interleaved 2-D descriptor + rowBytesruntime enum + virtual codecspull, incremental (some codecs)memory budget (partial)portable + runtimeupload onlyICC + CICP + PQ/HLG + gain maps
WuffsWuffs, Cup to 4 planes, byte strides, format wordinterfaces + vtablescoroutine, suspendablestructural capsin-language, runtimenonereported, never converted
libpngCrow sink, caller row pointersruntime tables + build macrospull, or push suspendablecaller-set per fieldper-ISA, compile-timenonechunks carried, gamma only
libspngCpacked caller buffer, no strideruntime enumpull, not suspendablecaller-set, open defaultper-ISA, compile-timenonechunks carried, none applied
libjpeg-turboCrow pointers or raw planesfunction tables + per-width buildpull, suspendable by retryopt-in (TurboJPEG)per-ISA + runtimenonenone (ICC bytes)
libwebpCinterleaved or YUVA planes, signed stridesruntime enum + tablespush, suspendable by replayfixed capsper-ISA + runtimenonenone (ICC passed through)
libjxlC++planar internal, interleaved at APIruntime compositionpush, suspendablebuilt-in, scaledportable + runtimenonecodestream encoding + ICC
libavifCplanar YUV, per-plane stridesruntime enum + tablespull, suspendablecaller-setdelegatednoneCICP (ICC bytes) + gain maps
OpenEXRC, C++struct of named planes, chunked, deepruntime enum + function pointerspull, chunk, random accesscaller-set (off)per-ISA, mixednonechromaticities
Little CMS 2Cruntime descriptor, strides as argumentsruntime tables + plug-insn/a (profile parse)fixed capsplug-in onlynoneICC (full CMS)
SimdC++2-D byte-strided view + format tagper-ISA copiespull, wholefixed capsper-ISA + runtimenoneYUV matrix only
HighwayC++lanes; planar padded rows in contribtemplates on a tag typen/anoneportable + runtimenonenone
KTX-SoftwareC, C++contiguous mip/layer block bufferC vtables + DFD datapull, wholebounds onlynoneVulkanDFD
basis_universalC++block gridruntime enum + switchwhole, syncfixed capsencoder onlyencoder OpenCLsRGB flag + DFD
Vulkan transferspecN-D texels or blocks per plane aspectruntime query + pNextn/avalid usage onlyn/aVulkan_SRGB suffix + YCbCr sampler

The 28 Tier B subjects and the Tier C digest enter the comparison below where they teach something a Tier A subject does not.

By dimension ​

1. Pixel and memory model ​

The field splits into four shapes. N-D strided views carry one stride per axis: mir-algorithm, VIGRA, Halide, OpenCV, NumPy and DLPack. 2-D descriptors with a row stride are the codec and graphics norm: Skia, Simd, Go image, Gamut, Dplug and OpenImageIO. Multi-plane images give each plane its own stride and extent: Wuffs, libavif, libheif, OpenEXR and nvImageCodec. No stride at all, the image as a pointer plus extents: stb_image, image-rs, zune-image, CImg, ITK and the arsd modules.

The strongest designs:

  • Halide's halide_buffer_t gives every dimension a min, extent and signed element stride, so interleaved versus planar is a stride permutation, a crop keeps the parent's coordinates through min, and negative strides flip without a copy (verified). Its limit is planes: YUV 4:2:0 is three buffers.
  • Wuffs pairs a pixel_config (one uint32 format word, subsampling, extents) with up to four planes, each with its own byte stride, which covers interleaved RGBA, planar YCbCr with chroma subsampling and a palette in one struct. It is 2-D only, with dimensions capped at 0xFF_FFFF.
  • libavif's avifImage carries per-plane strides, a subsampling enum, a chroma sample position and per-plane-group ownership flags, so codec planes can be borrowed and shallow view rectangles taken without copying.

The Slice experiment tested mir against the image cases. Planar 4:2:0 with independent pitches is three Canonical slices over one owner (verified, Planar YUV and padded strides); a byte pitch that is not a multiple of the pixel size has no pixel-typed Slice and needs a hand-built 3-D byte slice in @trusted code (verified).

Three failures recur:

  • No stride means no views. Crops copy, padded rows cannot be described, and 4:2:0 is unrepresentable: zune-image discards the PlaneInfo its own JPEG decoder produces, image-rs keeps strides only in the separate FFI FlatSamples, and dcv's Image class has no row stride, with views always ubyte* (verified: a 32-bit image viewed wrong).
  • Element strides cannot express every byte pitch. mir-algorithm, VIGRA and DLPack count strides in elements; Vulkan transfer counts bufferRowLength in texels or blocks, so a byte pitch that is not a multiple of the texel size needs a repack. Boost.GIL uses byte strides but shares one row stride across planes, so 4:2:0 does not fit.
  • 32-bit size arithmetic. Skia caps a raster at 2^31−1 bytes, Halide at 2^31−1 unless LargeBuffers, Gamut's row arithmetic wraps at 2 GiB (verified), and Dplug's int product for allocationSize is 0 for a 32768² RGBA image (verified).

GPU-bound data has its own model. KTX-Software stores all levels, layers, faces and depth slices of tightly packed texel blocks in one buffer addressed by byte offset, and prohibits multi-planar YCbCr. basis_universal describes a block grid (original and padded size, footprint, blocks per row, pitch in blocks), the minimum a compressed texture needs beside a pixel view. io_uring storage adds placement constraints rather than layout ones: page-aligned start, stx_dio_offset_align sizing and minImportedHostPointerAlignment for Vulkan import.

2. Genericity mechanism ​

Compile-time genericity is the choice of the generic-programming libraries: Boost.GIL (concepts as documentation, traits, tag dispatch, capability concepts that decide view types), VIGRA (trait classes and tag dispatch), mir-algorithm (structural constraints, SliceKind as a value parameter branched with static if), JuliaImages (multiple dispatch with Holy traits) and ImageSharp (C# 11 static abstract members). Run-time genericity is the choice of nearly every codec and production library: Skia, OpenImageIO, OpenCV, libvips, Little CMS 2, Wuffs, libjxl and every C codec.

The strongest designs:

  • ae.utils.graphics is design by introspection in D: isView, isWritableView and isDirectView predicates, optional primitives (opIndexAssign, scanline) propagated by static if through adapters and proven with static assert. Dplug reuses the same trait triple at its template edges.
  • zune-image keeps a run-time depth tag at the image boundary and monomorphises each kernel for u8, u16 and f32, with capabilities as static data checked by a provided execute. OpenImageIO does the same with a macro type switch inside its algorithms.
  • Wuffs and Skia resolve the pixel format at run time into one function pointer per conversion, keeping one compiled decoder. libjxl's authors record why: "dynamic polymorphism produces more compact executables than template reification did".

The common failures are on both sides. Run-time type codes go unchecked: OpenCV's Mat::at checks only in debug builds and does not compare the full type code (verified reinterpretation), and the type-code values changed between 4.x and 5.x (verified). Compile-time genericity pays in build cost and dead branches: VIGRA names instantiation count, compile time and object size; ImageSharp needs explicit instantiation inventories for AOT; ae.utils.graphics tests many branches only by instantiation, and three are broken at the pinned revision. Closed variants of run-time types appear on both sides: Boost.GIL's any_image, image-rs's DynamicImage and the SumType analogues the JuliaImages and image-rs lessons propose for D.

3. Colour and metadata ​

Most decoders store colour metadata faithfully and apply almost none of it. libpng validates iCCP in three stages but applies only a power-law gamma; libjpeg-turbo reassembles ICC from APP2 chunks and leaves it opaque; libavif carries ICC as bytes and fills CICP by a stated precedence (container colr, then sequence header, then decoded frame); libwebp skips ICCP, EXIF and XMP in the core decoder. Colour management sits outside the codec, in Little CMS 2, skcms (inside Skia) or OpenColorIO; the ICC page records that no decoder it read applies ICC itself.

The strongest designs:

  • Skia's SkColorSpace is a transfer function plus a 3x3 matrix to XYZ D50, built from CICP or from ICC through skcms, with PQ and HLG as tagged transfer functions with a reference white (verified), SkGainmapInfo and a gain-map codec.
  • Wuffs reports and never converts: parsed values (gamma, chromaticities, the four CICP bytes), raw passthrough byte ranges (eXIf) and raw transforms (an inflated iCCP), with alpha state part of the pixel format.
  • ImageSharp types alpha (P-suffixed premultiplied types and automatic conversion) and keeps CICP, ICC, EXIF, XMP and IPTC as metadata with a Preserve/Compact/Convert profile policy; image-rs is CICP-first, accepting ICC only by mapping it to CICP.

The CICP page adds a rule from crafted inputs: every carrier admits any byte, so a reader stores the integer, never a closed enum. libheif shows the cost of a single-answer API: an image may carry both nclx and ICC, and the query returns ICC, with a TODO in the header. HDR gain maps are a metadata record with three unit conventions across specifications (gain maps).

Common failures: colour dropped at decode (stb_image, Go, Godot, dcv); luma computed on gamma-encoded values with fixed weights (Boost.GIL, ITK, stb_image); 16-bit reduced to 8 bits (stb_image keeps the high byte, verified; Godot loads a 16-bit PNG as RGB8, verified); defects in the one D colour library (color: no chromatic adaptation applied, BT.709 using the camera OETF, alpha dropped through XYZ). Metadata models live apart from codecs: ExifTool (the widest catalogue, interpreted but never applied) and Exiv2 (typed keys, a cross-standard mapping table, ICC as an opaque buffer).

4. I/O and codec architecture ​

Whole-image pull is the default: image-rs (incremental decoding removed in 0.25.0), ImageSharp (its async API copies the stream into memory, then decodes synchronously), OpenCV, Boost.GIL, VIGRA, Go, stb_image and every D library read. Random-access pull by region serves tiled and pyramidal files: OpenEXR (offset table, chunk reads), libtiff (striles with deferred array loading), GDAL (Cloud Optimized GeoTIFF), OpenImageIO and libvips (demand-driven regions).

Suspendable decoders are rarer and take four forms:

FormSubjectsResumes by
Coroutine over caller buffersWuffsre-calling; state saved at any byte
Push state machinelibjxl, libpng push readerfeeding more bytes; libjxl copies partial sections internally
Pull with "would block"libavif (AVIF_RESULT_WAITING_ON_IO)repeating the call
Checkpoint and replaylibwebp, libjpeg-turbo, zune-image JPEGre-decoding from the last checkpoint or restart point

The forms differ in what a byte-at-a-time feed costs, and the deep-dives measured it. Wuffs produced the same pixel hash fed one byte at a time through a 16-byte buffer as from the whole buffer (verified); libjxl decoded a 3,540-byte file with 3,539 JXL_DEC_NEED_MORE_INPUT returns (verified); libwebp returned SUSPENDED 136,296 times on one lossless file and still matched the one-shot output byte for byte (verified), but lossless suspension re-parses the header on every replay.

Nearly every subject separates header from pixels: Wuffs's three phases (decode_image_config, decode_frame_config, decode_frame), image-rs's prepare_image and read_image, Go's DecodeConfig, ITK's ReadImageInformation, ImageSharp's Identify. Container and bitstream are separate in libavif (in-house ISOBMFF, AV1 behind avifCodec), libheif (a narrow push interface to codec plugins), libwebp (RIFF walk apart from VP8 and VP8L) and OpenEXR (exr_read_chunk and exr_uncompress_buffer callable alone).

Common failures: two readers in one library that disagree (libpng: a corrupt Adler-32 fails the sequential reader and yields 63 of 64 rows in push mode, verified; libspng: a truncated file yields 127 of 256 rows by stream and none by buffer, verified); a synchronous source that contradicts an asynchronous one (a Skia source comment says so); and probing that decodes (SAIL: the QOI describe step decodes fully, about 386 MiB resident to probe a 1.6 MB file, demonstrated).

5. Hostile input and safety ​

The defences, from strongest to weakest:

  • Proof. Wuffs proves bounds, overflow and null safety at compile time and forbids allocation, syscalls and globals; what stays unproved is the hand-written base, swizzler and wuffs_aux C. It has no work or time budget.
  • A limits record. libheif has a versioned heif_security_limits struct copied per context (pixels, tiles, memory block and total, items, children, extents, colour profile size), decode-count and decoded-pixel budgets against amplification, and cycle detection. libavif passes caller-set limits (pixel count, per-axis dimension, image count) on to dav1d and libaom.
  • Process-global limits plus ratio guards. OpenImageIO checks channels, resolution and image size in 29 of 30 reader plugins and rejects a claimed size above 10000 times the file size when it reaches 1 GiB; libtiff 4.7.2 added a compression-ratio plausibility check (verified).
  • Fixed caps and caller hooks. libpng, stb_image, libwebp and Simd compile their caps in.

The failure every deep-dive with a fuzzable parser found is allocation from declared sizes before validation: a 45-byte PNG makes libspng request 2 GiB (verified); a 72-byte PNG makes Go allocate 1526 MiB (verified); a 69-byte PNG makes Godot mmap 4 GiB (verified); KTX-Software turns an uncompressedByteLength of 2^40 into a 1 TiB request (verified); a 68-byte KTX1 makes Filament allocate 64 MiB (demonstrated); a 35-byte GIF makes SAIL reserve about 16.3 GiB of address space (demonstrated); libavif allocates a declared item size in full (verified). The second is limits that bound declared size but not work: libjpeg-turbo's 10,000 empty scans add about 10 s (verified), and OpenImageIO, Gamut and zune-image bound only size. The third is checks that vanish in release builds: mir-algorithm and the Slice experiment (bounds checks are asserts inside @trusted indexing, and public fields let @safe code widen a view, verified), Boost.GIL (BOOST_ASSERT), Gamut and Simd. The fourth is unchecked size products: ITK and VIGRA wrap to zero elements (verified), as do DLPack's GetDataSize and ROS cv_bridge (demonstrated).

libwebp's CVE-2023-4863 is the case study: Huffman tables were built before their completeness was validated, and the fix is validate-then-grow segments. Lenient defaults recur too: zune-image turns checksums off by default and fuzzes that configuration; libjpeg-turbo inserts a fake EOI and fills grey. Fuzzing on OSS-Fuzz is standard for the mature C codecs (libpng, libjpeg-turbo, libwebp, libjxl, libavif, OpenEXR, libvips, Wuffs); none of the D libraries read has a harness.

6. Allocation and ownership ​

Three ownership patterns cover the field. Caller owns everything: Wuffs cannot allocate, so the caller sizes the decoder with sizeof__ (44,648 bytes for PNG, verified), the work buffer from workbuf_len and the pixel buffer; libspng and OpenEXR write into caller memory and route internal allocation through a context hook. Owner and view as separate types: VIGRA (MultiArray owns, views borrow by value), Halide (the raw ABI owns nothing, Runtime::Buffer adds refcounting), Skia (SkPixmap borrows, SkBitmap shares a refcounted SkPixelRef, SkImage is immutable or lazy). Library-owned results: stb_image and Go allocate every output, JuliaImages leaves lifetime to the GC.

The strongest designs are Wuffs for codecs and Skia for an image library: the first makes allocation impossible inside the decoder, the second names three ownership levels and uses release callbacks for external memory. ImageSharp adds pooling (ArrayPool up to 1 MiB, 4 MiB unmanaged blocks, a ceiling at an eighth of available memory) and compares Span versus Memory to dip1000 scope.

Common failures: allocator hooks that internal containers bypass (libjxl's std::vector members skip JxlMemoryManager; libheif and libvips leave codec-internal buffers outside their budgets); views with no tie to their owner (mir-algorithm, where the Slice experiment caught a stack-use-after-return under ASan in @safe code over a UniqueBuffer; ae.utils.graphics, whose gamma view returns a dangling pointer that dip1000 accepts, verified); implicit sharing that detaches silently (OpenCV create(), verified); and a conversion step per allocation (stb_image holds two full images at peak when converting channels). libjxl's working set grows with threads (about 11.3 MB on one thread, 15.5 MB on four, verified).

7. CPU parallelism and SIMD ​

SIMD dispatch takes five forms in the field:

FormSubjects
Portable vector library, runtime dispatchHighway, OpenCV universal intrinsics, libjxl and libvips on Highway, Skia raster pipeline
Per-ISA hand intrinsics, runtime dispatchlibjpeg-turbo, libwebp, Simd, zune-image, libyuv, ImageSharp
Per-ISA code in the languageWuffs (choose cpu_arch, resolved once per object)
Compile-time onlylibpng 1.8, libspng, OpenImageIO, intel-intrinsics, Dplug
Auto-vectorisation, no dispatchmir-algorithm, VIGRA, ITK, JuliaImages, dcv, ae.utils.graphics

Highway is the strongest dispatch design: 28 targets (the README says 27) as one-bit feature clusters, CPUID plus XCR0 detection, a lazy first-call export table, and tests that run every compiled target in one binary. The deep-dive reproduced its shape in D with @target, static foreach and a CTFE table. Its cost is measured: about 6.8 times the compile time for eight x86 targets. libyuv shows the plane-loop over a row-kernel split, with each function tested against its C path.

The measured gains are uneven. zune-image's JPEG intrinsics are about 1% faster than none on the project's own machine; Simd's bicubic resize is slower in AVX-512BW, the variant its dispatcher picks, than in AVX2, and memory-bound operations are flat after SSE4.1 (Zen 4). The failures are dispatcher duplication (Skia has three, OpenEXR three inconsistent mechanisms), detection without the OS state check (Simd never reads XCR0), a dispatcher compiled with the widest flags (Simd executes VEX instructions on an SSE4.2 CPU and gets SIGILL, verified), mutable global function pointers (libwebp, libyuv's MaskCpuFlags, not thread-safe), and in D, intel-intrinsics's static if ladder that @target does not reach (verified) and that fails to build on LDC 1.43.0 (verified, also reported by Dplug and dcv).

Threading follows one rule across the codecs: the library creates no threads. libjxl takes a caller JxlParallelRunner over an integer range; libtiff and libjpeg-turbo expect one object per thread. Engines that own threads pay in memory: a libvips pipeline peaked at 50.4 MiB on one thread and about 215 MiB on 32 (verified); Little CMS 2's threaded plug-in spawns a thread per slice per call (69 Mpixel/s default, 761 on 32 threads). The schedule as a separate object is Halide's contribution: parallel, vectorize and tail strategies attach to an unchanged algorithm (algorithm and schedule).

8. GPU offload and interop ​

Most still-image libraries have no GPU path (23 of the 30 Tier A rows). The subjects that do fall into upload, decode and compute:

  • Upload. Skia Graphite fuses colour and format conversion into the staging write (TextureFormatXferFn) and Ganesh walks a lazy-image ladder (cache, native texture, YUV planes converted on the GPU, CPU upload). KTX-Software uploads with a staging buffer, one VkBufferImageCopy per level and a blocking vkWaitForFences with a 100-second timeout. Vulkan transfer tabulates, per device, transfer-only queues, host image copy, resizable BAR, host-pointer import alignment, dma-buf and GDeflate decompression (NVIDIA only on the matrix).
  • Storage to GPU. DirectStorage is the only subject where read, decompression and copy into a sampled resource are one call with one fence. io_uring storage found that host-pointer import of a page-aligned, registered slab (route 2) is the simplest zero-copy path that worked on every device measured, and that neither route reaches device-local memory. GPUDirect Storage and Metal are the closed counterparts.
  • Compute. Halide makes offload a schedule property with two dirty bits as the coherence protocol; its Vulkan runtime calls vkQueueWaitIdle per dispatch. nvImageCodec splits JPEG into host entropy decode, transfer and device reconstruction with double-buffered pinned staging. OpenColorIO emits shader text plus LUT textures and validates every GPU op against its CPU path.

Common failures: implicit offload with a silent fallback (OpenCV's T-API swallows exceptions; bgfx falls back to CPU-decoded BGRA8, 32 bits per pixel against 0.89 to 8 for the compressed formats); synchronous waits inside an otherwise asynchronous pipeline (Halide, KTX-Software); and GPU decompression treated as safe (nvCOMP declares corrupt input undefined behaviour; the DirectStorage reference GDeflate CPU decoder overflows under ASan, verified). The seam the codecs offer is caller-owned strided output: libpng rows, Wuffs planes and libwebp MODE_YUVA planes can point at mapped staging memory. In D, dcompute has no Vulkan target in the library at its pin, and its OpenCL image path produces invalid SPIR-V or crashes the backend on this toolchain.

9. Temporal, animation and containers ​

Animation is a codec property in the strongest designs. Wuffs's frame_config carries a rectangle, duration, disposal, blend and I/O position, with restart_frame for random access; Skia's FrameInfo adds a required prior frame so a client can skip re-decoding; libjxl has a native tick rate, blending onto up to four reference frames and raw layers when coalescing is off. libavif reads image sequences as ISOBMFF tracks with per-frame pts, keyframe seeking and alpha as a second track; libheif applies edit lists by default, so an infinite-loop file never ends unless the caller opts out.

The common failure is composited full canvases: image-rs, ImageSharp, SAIL and zune-image return every frame at canvas size, losing frame rectangles, disposal and blend, so lossless delta re-encoding is impossible and a GPU path uploads the whole canvas per frame (SAIL). Libraries without a frame model use an axis: ITK, JuliaImages, VIGRA and mir-algorithm treat time as one more dimension with no timestamps. KTX-Software stores animation as array layers with KTXanimData, a sprite-sheet model; ROS puts a stamp on every frame and pairs image with calibration by exact timestamp. Video belongs to the video catalog; this dimension records only what a still-image library must hold so that the video work can reuse it.

10. Testing and conformance ​

Four kinds of oracle appear:

  • External conformance corpora. libjxl runs a pinned conformance corpus per codestream level and per SIMD target (11 targets, AVX3 under Intel SDE), comparing with per-test RMSE and peak-error limits; libwebp uses external VP8 and lossless vectors; PngSuite backs libpng, libspng, stb_image and Go.
  • Differential tests against another implementation. libspng against libpng over 175 PngSuite images in every output format; Wuffs mimic tests plus a committed CRC-32 of every decodable file's output; zune-image's HEIC decoder byte-identical to libheif; ImageSharp against Magick.NET and System.Drawing with a tolerant comparer; KTX-Software's ktx validate as an independent reader.
  • Path equivalence. Highway runs every test per compiled target in one binary and fails tests that bypass dispatch; libyuv runs each function with C and SIMD; Simd compares every variant against its base path on odd sizes; libwebp has a fuzzer asserting incremental equals one-shot; Skia runs each image through seven decode modes.
  • Tolerant image comparison. OpenImageIO's idiff (threshold, failure percentage, hard ceiling), ITK's baselines with intensity and radius tolerances, libvips's pixel-against-scalar oracle.

The common failures: round-trip tests cannot catch a consistently wrong decoder (Boost.GIL's Adam7 read defect passes them); untested template branches break unseen (ae.utils.graphics tests some only by instantiation, and in dcompute defects survive because no test instantiates them); fuzz targets built but not run in CI (image-rs); CI that silently narrows coverage (Simd: a Nix wrapper stripping -march=native gave a green run of the base path only, verified); and a D CI removed with nothing replacing it (dcv, whose dub test :core fails on both current compilers, verified).

Consensus ​

What nearly every mature subject does, with the evidence.

  1. Read the header before the pixels, and size from it. A header-only call precedes pixel decode in Wuffs, image-rs, Go, ITK, ImageSharp, OpenCV, libavif and OpenImageIO. Its purpose is that the caller can refuse or allocate.
  2. Decode into caller memory with a caller stride. libpng row pointers, libjpeg-turbo row arrays, Wuffs pixel buffers, OpenEXR channel slices, Skia codecs, libspng and decode_into in image-rs and zune-image. The library allocates scratch, not results.
  3. Check declared dimensions before allocating. The subjects with a limits record, global limits or structural caps check them ahead of allocation (libheif, libavif, OpenImageIO, stb_image, Wuffs); the deep-dives reproduced allocation bombs in the subjects that check after allocating or not at all (Hostile input). This is consensus as practice, not as universal implementation.
  4. Carry colour metadata, apply it elsewhere. Codecs store ICC and CICP and leave transforms to a colour engine (libpng, libavif, libjpeg-turbo, libwebp, Wuffs, ICC).
  5. Keep container and bitstream apart. libavif, libheif, libwebp, OpenEXR, libtiff and KTX-Software separate the box, chunk or IFD walk from the codec.
  6. Let the caller own threads. Codecs create none (libjxl, libjpeg-turbo, libtiff, Wuffs, libyuv, OpenColorIO); only engines (libvips, OpenImageIO, ImageSharp) own a pool.
  7. Choose SIMD at run time against a scalar reference that tests can force.libjpeg-turbo (environment overrides), libwebp (set the CPU info pointer to NULL), zune-image (set_use_unsafe(false)), libyuv, Highway, ImageSharp (rerun with intrinsics disabled).
  8. Fuzz continuously. OSS-Fuzz or an in-tree harness run in CI for libpng, libspng, libjpeg-turbo, libwebp, libjxl, libavif, libheif, OpenEXR, Wuffs and libvips.
  9. Register formats by content, not name alone. Magic-byte sniffing with a registry: Go (wildcard patterns, first match), Skia (isFormat records), SAIL (.codec.info files read without loading the codec), nvImageCodec (priority-ordered with per-sample fallback), OpenCV (content signature).

Trade-offs ​

The forks where mature subjects chose opposite sides, and what each side cost.

Element strides versus byte strides ​

Compile-time pixel types versus runtime type codes ​

  • Compile-time: Boost.GIL, VIGRA, JuliaImages, ImageSharp, ae.utils.graphics. Kernels specialise with nothing virtual in loops; the price is compile time, object size, AOT inventories and a closed run-time variant wherever a file decides the type.
  • Runtime: Skia, OpenCV, OpenImageIO, Wuffs, libjxl, Little CMS 2. One binary, smaller code and a stable ABI; checks move to run time and are skipped in release builds (OpenCV), and a format product is handled by function-pointer tables or stage lists.
  • Hybrid: zune-image and OpenImageIO tag at the boundary and monomorphise inside; Skia makes the ISA the one compile-time axis. The Slice experiment adds that Slice carries no pixel format, alpha state or colour, so a runtime descriptor beside the view is needed whichever view type is chosen.

Pull versus push versus suspendable decode ​

  • Blocking pull: image-rs, OpenCV, libspng, Skia. Simplest code; an asynchronous caller must buffer the whole file first (ImageSharp does exactly that).
  • Push: libjxl, libwebp, libpng. Fits a completion loop; the library keeps partial input or replays from a checkpoint, and libpng's two readers disagree on corrupt input.
  • Suspendable over caller buffers: Wuffs. Exact resumption at any byte with no hidden copy; the cost is a language and compiler of its own and a slow coroutine path beside the fast one.
  • Pull with "would block": libavif. Keeps a pull-shaped API and still suspends; the call is repeated, so work done before the stall must be idempotent.

Caller-set limits versus fixed caps ​

  • Caller-set: libheif, libavif, image-rs, libspng, OpenEXR. Policy belongs to the application; the defaults decide real safety, and libspng and OpenEXR default to open (verified 2 GiB request; OpenEXR limits default to 0, disabled).
  • Fixed caps: libwebp, stb_image, Simd, Wuffs (structural). Always on; cannot be tightened for a server or loosened for a gigapixel scan.
  • Process-global: OpenCV (environment variables read at static initialisation), OpenImageIO. One setting for every decode in the process, which a library inside another library cannot own.

Per-ISA kernels versus portable SIMD ​

  • Per-ISA hand intrinsics: libjpeg-turbo, libwebp, Simd, libyuv. Peak control per instruction set; bodies drift (libpng: dead LoongArch and RISC-V code and a Neon tail bug; Dplug: the L16 blend without a twin is off by one) and the build matrix grows.
  • Portable library: Highway, OpenCV, libjxl, libvips. One source; compile time multiplies by the target count and some operations (shuffles, narrowing) still need per-target code (Highway).
  • Auto-vectorisation: mir-algorithm and the D libraries. No dispatch at all; the result depends on the compiler and the build mode. The Slice experiment found the idiomatic windows blur scalar under the shipping checked build while the hand loop vectorised (verified), and @fmamath permits FMA contraction against an exact oracle (documented, not tested).

One library versus format plugins ​

  • One library with build switches: CImg (a 71,779-line header), VIGRA, stb_image, libjxl, ImageSharp. One dependency to pin; every consumer takes every format's attack surface and compile time, and trimming is not evidence that unused codecs disappear.
  • Core plus per-format packages: zune-image (one crate per codec over a tiny core), Go (codecs register into a codec-free core), arsd, SAIL, Boost.GIL. Consumers take one codec, fuzzed alone; the price is a shape convention rather than a shared trait, re-wrapping, and cross-package version pinning (JuliaImages).
  • Runtime plugins: GDAL, OpenImageIO, libheif, nvImageCodec. New formats without rebuilding; dynamic loading and global registries conflict with -betterC, wasm and Android builds (Skia, ITK).

Owner type versus bare view ​

  • Owner and view distinct: VIGRA, Skia, Halide, ImageSharp. Lifetimes are explicit; two types to learn and convert.
  • Bare view, ownership in the iterator: mir-algorithm. One type for both; a view can outlive the buffer it borrows, and dip1000 did not stop it in the Slice experiment.
  • One type with a shared flag: CImg, Gamut. Simple; the owner/view distinction is lost and dangling views are the cost.

Answers to the nine questions ​

Each answer gives the evidence the catalog gathered, the choices it leaves open, and the deep-dives that carry it.

Q1. Pixel and memory model ​

Evidence. Three designs cover the image cases between them: an N-D view with per-axis strides (Halide, mir-algorithm, VIGRA), a multi-plane 2-D buffer with per-plane strides and subsampling (Wuffs, libavif) and a block grid for GPU textures (KTX-Software, basis_universal). The Slice experiment verified that mir's three SliceKinds map onto tight images, padded rows and crops, and transposes or single channels, and that 4:2:0 with independent pitches is three Canonical slices over one owner. It also verified the three counterpoints: no pixel-typed view for a byte pitch that is not a multiple of the pixel size, no owner, and bounds checks that vanish in release builds. CICP adds that a YCbCr view needs matrix, range and chroma location, which a bare strided view does not carry.

Open. Element or byte strides; one N-D view with planes as separate views, or a plane-group type; whether the block grid shares the pixel view's type; where the runtime descriptor (format, alpha, colour) lives beside the view.

Carried by mir-algorithm, the Slice experiment, Halide, Wuffs, libavif, Boost.GIL, VIGRA, KTX-Software, basis_universal, DLPack.

Q2. Generic interfaces in D ​

Evidence. Design by introspection already works for image views in D: ae.utils.graphics propagates optional primitives through adapters and proves them with static assert, and Dplug reuses the trait triple. The Slice experiment compiled non-template @safe pure nothrow @nogc kernels over Slice parameters with dip1000 on DMD and LDC, and found that lambdas reading other planes allocate closures, so @nogc code needs functors. Boost.GIL shows D avoids most of GIL's proxy machinery with opIndex and opIndexAssign (verified planar view @safe pure nothrow @nogc). Cross-language ideas that transfer: capability-as-data checked before and after an operation (zune-image), closed run-time variants over a small canonical set (image-rs, JuliaImages), and run-time capability queries for device features (Vulkan transfer).

Open. Which capabilities are traits; whether the codec boundary returns a SumType or a runtime descriptor; how much instantiation the build tolerates (no deep-dive measured D object size).

Carried by ae.utils.graphics, Dplug, Boost.GIL, zune-image, image-rs, JuliaImages, ImageSharp, mir-algorithm.

Q3. Generic algorithms that stay fast ​

Evidence. Lazy composition is free when it inlines: ae.utils.graphics compiles a double hflip to the same code as direct indexing (verified), and the Slice experiment matched hand loops byte for byte with map, vmap and windows. Vectorisation is not free: the idiomatic windows blur stays scalar under checked (verified). Algorithm/schedule separation is Halide's answer; the row-kernel-over-plane-loop split is libyuv's and ImageSharp's; Skia's raster pipeline handles the format product with runtime stage lists over portable per-ISA source. One dispatch facility for all kernels is the lesson of OpenEXR, Skia, Wuffs and Simd; batch conversion has to be designed in (color).

Open. Whether a schedule is an explicit object or a template parameter; whether kernels are row functions or whole-view functions; how far @target plus a scalar reference goes before a portable vector layer is needed.

Carried by Halide, Highway, libyuv, Skia, ImageSharp, ae.utils.graphics, the Slice experiment.

Q4. Codec architecture ​

Evidence. Suspendable decoding over caller buffers is Wuffs's design, verified byte-at-a-time equal to whole-buffer decode; push state machines (libjxl, libwebp) and pull with "would block" (libavif) are the alternatives, with measured replay costs. Hostile-input safety comes from checking before allocating, a limits record (libheif) and continuous fuzzing (Hostile input). For sparkles:wired, the deep-dives name what a binary description must express: the RIFF chunk grammar (libwebp), the ISOBMFF item graph (libavif), KTX2 and .basis containers with DFD and key-value data (basis_universal), PNG chunk ordering and multiplicity as a table (libpng), TIFF's runtime byte order and offset width (libtiff), Exif maker notes with nested base offsets (Exiv2), compile-time packed bit layouts (color) and zero-copy layout views (ae.utils.graphics). The wired baseline records that Flat as drafted has no bit reader (G2), no short-read status (G3), no range checksums (G4) and no runtime byte order or 64-bit offsets (G5). The wired experiment put PNG, QOI and ISOBMFF framing against Flat and shipped wired: the shipped schema covers fixed records with checks, Flat would add length-prefixed members and per-tag dispatch, and neither covers range checksums, references by ID, suspension or caller budgets on derived values; its requirements are IMW1 to IMW25.

Open. Which suspension form; whether bit-level reading belongs to sparkles:wired or to the codec layer; whether container parsing is shared between metadata and pixel codecs (Exiv2 argues it must be).

Carried by Wuffs, libjxl, libwebp, libavif, libpng, libspng, libheif, OpenEXR, libtiff, basis_universal, the wired experiment.

Q5. Colour, HDR and metadata ​

Evidence. The minimum the field carries is CICP as four stored integers (CICP), ICC as bytes with a parsed summary (ICC, skcms inside Skia), an alpha state (Wuffs, ImageSharp), an EXIF orientation (image-rs, Skia) and opaque EXIF and XMP ranges. HDR adds PQ and HLG transfer functions with a reference white (Skia), mastering-display and content-light-level values that travel beside CICP (CICP), and a gain-map record (gain maps, applied in linear light). Full colour management is separable (Little CMS 2, OpenColorIO); a separate metadata model is ExifTool's and Exiv2's.

Open. Whether colour lives in the pixel type (JuliaImages, VIGRA) or in a descriptor (Skia, Wuffs); whether a CMS is bound (lcms2) or written; how much of EXIF and XMP is parsed.

Carried by Skia, Wuffs, CICP, ICC, gain maps, Little CMS 2, ImageSharp, image-rs, ExifTool, Exiv2, color.

Q6. File to GPU ​

Evidence. On Linux, a page-aligned slab registered with io_uring and imported with VK_EXT_external_memory_host gives file reads straight into Vulkan-copyable memory on RADV and llvmpipe (io_uring storage); vkMapMemory memory cannot be registered on RADV; and the binding's multi-buffer registerBuffers registers only the first slot, so registered-buffer measurements need that fix first. Vulkan transfer shows no single path covers the device matrix, so the path is chosen from queried facts. GPU decompression replaces CPU inflate, not upload, runs only on graphics or compute queues, and is NVIDIA-only on the matrix (Vulkan transfer). DirectStorage argues that the unit is a request sized to a staging buffer and decodable alone, which monolithic PNG IDAT does not give; KTX-Software's level index is already such a request list. Format negotiation at load (Filament, basis_universal) decides between BC7, ASTC, ETC2 and RGBA8.

Open. Whether the read-into-importable-slab logic sits with event-horizon or the Vulkan layer; whether a separate external-memory type is introduced; how a GPU completion reaches the loop (timeline semaphore or pollable fence).

Carried by io_uring storage, Vulkan transfer, DirectStorage, KTX-Software, Skia, nvImageCodec, the Tier C digest.

Q7. SIMD versus GPU compute ​

Evidence. No deep-dive measured a break-even. The evidence is indirect: measured SIMD gains are uneven (zune-image, Simd); libjpeg-turbo names IDCT, upsampling and colour conversion as GPU candidates and Huffman as not; GDeflate reshapes an entropy bitstream into coarse tiles for threads and 32-way interleave for lanes; nvImageCodec balances GPU and CPU by measured idle time instead of a cost model. What the two kernel forms share: OpenColorIO validates every GPU op against its CPU path with one kernel signature over packed RGBA float rows, and the gain-map apply is a natural first kernel with both forms.

Open. Where break-even lies for each kernel class; whether kernels share one source between host SIMD and SPIR-V; how a test harness times both.

Carried by Highway, Simd, zune-image, libjpeg-turbo, OpenColorIO, Halide, DirectStorage, nvImageCodec, dcompute.

Q8. Correctness ​

Evidence. The strongest oracles are external corpora with tolerances (libjxl), differential tests against another decoder (libspng, Wuffs, zune-image), path-equivalence tests across SIMD targets and decode modes (Highway, libyuv, Skia, libwebp) and tolerant image comparison (OpenImageIO). Free oracles named by the deep-dives: CICP tables checked exhaustively against libavif, dav1d and FFmpeg (CICP); ExifTool's expected outputs as a metadata corpus (ExifTool); two QOI decoders as independent oracles (QOI); Wuffs' ETC2 decoder for texture blocks (Wuffs). Allocation-bomb and truncation corpora are what the field's failures argue for (Hostile input).

Open. Which corpora are pinned as flake inputs; exactness or a stated tolerance per kernel; where the image oracle package sits.

Carried by libjxl, libspng, Wuffs, Highway, libyuv, OpenImageIO, CICP, ExifTool, Simd, Boost.GIL.

Q9. Package boundaries ​

Evidence only; the decision is not made here.

For a split along dependency lines. ae.utils.graphics, dcv, Dplug and the arsd modules (the D precedents) all split core from codecs by external dependency. zune-image publishes one crate per codec over a tiny core; Go registers codecs into a codec-free core; SAIL, OpenCV, ITK and ROS separate types, codecs and operations. libyuv and Simd show pixel operations standing apart from formats; libspng shows a PNG codec needs only a row sink, not an image-core package. Colour management is separable (Little CMS 2, ICC, OpenColorIO); a dependency-free CICP type belongs in the smallest shared package (CICP); the gain-map record goes with colour metadata (gain maps).

Against a split, or for fewer pieces. libvips does not demonstrate an independent engine package, and OpenImageIO's algorithms cannot be separated from I/O because its buffer reads lazily. Boost.GIL's algorithms migrated into core over time. JuliaImages's fine-grained split costs compatibility pinning. Gamut keeps one package and selects codecs by build configuration.

What the unsplit option grows into. CImg (one 71,779-line header with container, algorithms, codecs, display and an expression language) and VIGRA (container, codecs, colour, algorithms, graph and ML in one library).

Build-mode constraints. Static initialisers and dynamic loading conflict with -betterC, wasm and Android (Skia, ITK, Simd, Highway); the Slice experiment verified mir kernels under -betterC (LDC; DMD without Vector) and as wasm32 modules, the latter only when mir's own modules are not compiled, so not through dub, and records that mir is in neither Nix dub lock. SIMD dispatch is a base-layer concern below any image package (Highway, intel-intrinsics); the importable-slab logic belongs with I/O and GPU packages, not image core (io_uring storage); dma-buf belongs in a Linux-only module (Vulkan transfer); DLPack is a thin optional module over the view (DLPack, NumPy).

Carried by every deep-dive's Q9 lesson; the densest are zune-image, Skia, OpenCV, Go, CImg and the Slice experiment.

Delta against the baseline ​

Each capability the field has, mapped to where Sparkles stands. Status values follow the baseline documents: shipped (code on this branch), specified (accepted spec text), draft (unmerged branch or draft spec), planned (named in a plan only), absent (nothing found). Gap IDs are the "Gaps and tensions" entries of the baseline document named in the same row.

CapabilityField evidenceSparkles statusBaseline and gap
Strided 2-D pixel viewSkia, Wuffs, Simdabsent (flat ImageData.rgba, ColourRegion data plus stride)existing code G2
N-D strided viewmir-algorithm, VIGRA, Halideabsent (guideline recommends mir.ndslice; no mir dependency)existing code G2; shaders G10
Planar and subsampled YCbCr planeslibavif, Wuffs, libwebpabsentexisting code G2; Vulkan G1
Sample types beyond 8-bitOpenImageIO, OpenEXR, libjxlabsent (ui.png drops 16-bit to the high byte)existing code G4; shaders G3
Declared alpha stateWuffs, ImageSharpshipped, split convention (premultiplied glyphs, straight registry)existing code G3
Header-only probe before decodeWuffs, image-rs, Godraft (pngHeader in sparkles:image on refactor/image-png)existing code DRAFT; G1
Decode into caller storagelibspng, Wuffs, OpenEXRshipped (font.png, limited forms); draft (sparkles:image)existing code G1, G6
Suspendable or incremental decodeWuffs, libjxl, libavifabsent (both decoders whole-file, single-shot)existing code G7; wired G3
Decoder as a resumable state machineWuffsabsent; started fibers are pinned, so a plain struct is requiredevent-horizon G6
Bit-granular readerWuffs, libjxlabsent; Flat excludes itwired G2
Binary description of container formatslibwebp, libavif, basis_universaldraft (Flat WFL1-WFL56, OpenType acceptance set only)wired G1, G5, G6, G15
Chunk CRC and checksum verificationWuffs, libpngabsent (both PNG decoders skip CRCs)wired G4
Caller-set limits recordlibheif, libavifshipped, narrow (maxPngPixels; font FTB3 fixed limits)wired G8; existing code G7
Work budget against amplificationlibheif, libjpeg-turbodraft (Flat traversalBytes, font-shaped)wired G8, G17
Fuzz harnesses in CIlibwebp, libspng, libheifabsent; sanitizer and fuzzer runtimes plannedexisting code PLANNED; G11
Crash isolation of hostile decodesGDAL (deployer sandboxing)shipped (ForkServer, serial, single-threaded start)event-horizon G9
Unified error type for codecsWuffs (status strings), libheifabsent; error types fragment across packageswired G9
CICP and ICC carriedlibavif, Skia, image-rsabsent (ancillary chunks skipped)existing code G4, G5; wired G15
Colour management (ICC transforms)Little CMS 2, Skiaabsentexisting code PLANNED; Vulkan G10
HDR transfer functions and gain mapsSkia, libavif, gain mapsplanned only for linear light (UVX6); HDR absentVulkan G10
EXIF orientation and metadata reportimage-rs, ExifToolspecified as a template only (font-explorer inspect, not started)existing code G5
Animation frames with rectangle and disposalWuffs, Skia, libjxlabsentexisting code G9, G14
Runtime SIMD dispatch, publicHighway, OpenCV, Wuffsshipped for text and BLAKE3 only, package visibility, x86 LDCshaders G5; existing code G13
Scalar reference forced by testslibyuv, Highway, zune-imageshipped for BLAKE3 (every backend against portable)shaders capability table
Shared resampling and filter layerlibyuv, Simd, ImageSharpshipped as two private copies (sampleArea, rasterizeBitmapGlyph)existing code G10
CPU offload pool for decode sliceslibjxl (JxlParallelRunner)shipped three ways with different contractsevent-horizon G5, G7, G12
Ranged reads with bounded reads in flightOpenImageIO (IOProxy), GDALabsent (offset OpRead only)event-horizon G1
Registered buffersio_uring storageshipped (BufferPool); multi-slot registration registers one slotevent-horizon capability table
O_DIRECT and mapped filesio_uring storage, libtiffabsent; mapped-file byte source planned (Flat O1)event-horizon G3; wired G14
Host-pointer import into Vulkanio_uring storage, Vulkan transferabsent; allocator cannot hold imported regions (VKM3)Vulkan G6; event-horizon G4
dma-buf and DRM modifiersVulkan transferabsent (extensions present locally, not bound)Vulkan capability table
Strided, sub-image, layered and mip uploadVulkan transfer, KTX-Softwareshipped for tight RGBA8 and R8 onlyVulkan G1; existing code G8
Transfer queue and timeline semaphoresVulkan transfer, nvImageCodecabsent (one graphics queue, binary semaphores)Vulkan G3, G4
GPU completion to event loopDirectStorage, Metalplanned (a dispatch.d comment on a pollable sync_fd)Vulkan G5
YCbCr sampler conversionVulkan transfer, CICPabsent (core 1.1, not bound)Vulkan capability table; G10
Block-compressed textures (KTX2, Basis)KTX-Software, basis_universal, glTFabsentexisting code capability table
GPU decompressionVulkan transfer, DirectStorageabsent (declared in the header, advertised by no local device)Vulkan capability table
Compute pipelines and storage imagesHalide, OpenColorIOspecified (shaders M10), not started; commands not boundshaders G1, G9; Vulkan G7
Device format and limit queriesVulkan transfer, KTX-Softwareshipped partly (GetPhysicalDeviceFormatProperties, maxImageExtent)Vulkan G13
GPU timing for break-evennone measured in the fieldabsentshaders G7
Decoder differential oraclelibspng, Wuffsshipped for PNG only (png_oracle.d, stb_image over PngSuite)existing code G11
Tolerant image comparisonOpenImageIO, ImageSharpabsent (golden screenshots compare bytes)existing code G11
Exact oracle for 8-bit GPU kernelsOpenColorIO (tolerance), libyuvabsent (agreement oracle calibrated for float shading)shaders G8
DLPack exportDLPack, nvImageCodecabsentexisting code G14
-betterC, wasm and Android reach of codec coreWuffs, zune-image, Slice experimentunverified for image code; event-horizon tier A betterC planned (O3)existing code G12; event-horizon G13

Sources ​