Skip to content
CAI
Software that uses CAICheck a score

image-rs/image

67.2

Adequate · 29 September 2026

36.6k

lines of production code

Rust

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a comprehensive Rust library for image processing that provides robust decoding and encoding capabilities for a wide variety of formats, including JPEG, PNG, WebP, AVIF, TIFF, and animated images. It offers extensive image manipulation features such as resizing, blurring, color space conversion, and affine transformations, supported by a modernized I/O architecture and strict memory safety limits. The codebase also includes detailed benchmarking, fuzzing infrastructure, and numerous examples to demonstrate core functionalities like metadata extraction and format-specific optimizations.

How it got here

2014 — core infrastructure and codec expansion

9 changes.

The project established its foundational repository structure and license model while significantly expanding its core image processing capabilities. This period saw the introduction of advanced animation support, high-precision color types, and a comprehensive suite of image transformation operations. Additionally, the codebase integrated external crates for JPEG handling and implemented full WebP codec support, accompanied by extensive test coverage to ensure reliability.

2015–2019 — Image processing infrastructure and testing

11 changes.

This period focused on establishing a robust internal infrastructure for image processing, introducing new modules for mathematical operations, utilities, and a restructured I/O layer with strict decoding traits and limits. Significant effort was also dedicated to stability and performance verification through the addition of comprehensive fuzzing harnesses, regression tests, and a new benchmark suite for image operations.

2020 — Codec expansion and refactoring

11 changes.

This period focused on significantly expanding format support by adding codecs for AVIF, HDR, Farbfeld, and QOI, while introducing fuzzing targets for PNM and WebP. Concurrently, existing decoders and encoders for BMP, ICO, PNM, TGA, and GIF underwent major architectural rewrites to improve robustness, add features like ICC profile support, and enforce stricter validation.

2021–2025 — Image core restructuring and color support

5 changes.

The project reorganized its core image handling types into a dedicated module, introducing generic buffers and parallel iteration support. It also added a new color space conversion engine based on CICP for accurate transformations and expanded the example suite with image concatenation and Gaussian blur demonstrations.

Features

Add AVIF image encoding and decoding support

Users can now read and write AVIF images. The new decoder supports 8, 10, and 12-bit depths, extracts ICC profiles and EXIF metadata, and correctly handles image orientation (rotation and mirroring) from the container. The encoder supports configurable speed and quality settings, allows setting the color space (sRGB or BT.709), and can embed EXIF metadata.

src/codecs/avif · high confidence

Add Radiance HDR image codec support

Users can now decode and encode Radiance HDR images. The decoder converts HDR files into 32-bit floating-point RGB images, while the encoder supports writing 32-bit floating-point RGB data to HDR files using run-length encoding.

src/codecs/hdr · high confidence

Add fast blur example using Gaussian blur parameters

A new example located at examples/fast\_blur demonstrates applying a Gaussian blur to an image. The example loads a test image using ImageReaderOptions and applies a blur with a sigma of 10.0 via GaussianBlurParameters, saving the result to mandril\_color\_blurred.tif.

_examples/fast\blur · high confidence

Add horizontal image concatenation example

A new example demonstrating how to horizontally concatenate multiple images into a single output file has been added to the examples/concat directory. Users can run this example to see a generic implementation that combines images of the same pixel type side-by-side, calculating the total width and maximum height to create the resulting image buffer.

examples/concat · high confidence

Add scaledown example demonstrating image resizing and thumbnailing

A new example program has been added to demonstrate image scaling capabilities. It iterates through various filter types (Nearest, Triangle, CatmullRom, Gaussian, Lanczos3) to resize an input image to 400x400 pixels, measuring and printing the execution time for each. Additionally, it generates thumbnails at various sizes (20, 40, 100, 200, 400 pixels) using the thumbnail method, saving the results as PNG files.

examples/scaledown · high confidence

Add scaleup example demonstrating image resizing performance

The examples/scaleup directory now includes a main.rs file that demonstrates resizing a small image to larger dimensions using various filter types (Nearest, Triangle, CatmullRom, Gaussian, Lanczos3) and measures the execution time for each operation.

examples/scaleup · high confidence

Added fuzzing harness infrastructure and documentation

Introduced a new fuzzing directory containing integration fuzzing harnesses for decoders not yet in their own crates, along with a README explaining how to build and run the fuzzer using AFL, and a minimize script to reduce crash inputs for easier reproduction.

fuzz-afl · high confidence

Initial project scaffolding and license restructuring

This change establishes the initial repository structure by adding configuration files for Git (\.gitattributes\, \.gitignore\), linting (\clippy.toml\, \deny.toml\), and a release script (\release.sh\). It also introduces the \CHANGES.md\ file to document the upcoming 0.25.9 release, including new features like XMP/IPTC metadata extraction and structural changes such as the removal of \ImageDecoderRect\. Additionally, the project license is restructured from a single MIT license to a dual MIT OR Apache-2.0 model, replacing the old \LICENSE\ file with \LICENSE-MIT\ and \LICENSE-APACHE\.

(repo-wide) · high confidence

New CICP-based color space conversion engine

The library now includes a new \src/metadata\ module that implements color space transformations using Coding Independent Code Points (CICP) via the \moxcms\ backend. This adds support for parsing ICC profiles into CICP metadata and performing accurate color conversions between various standard color spaces (such as sRGB, BT.709, BT.2020, and DCI-P3) and transfer characteristics (including PQ and HLG). Users can now leverage \DynamicImage::apply\_color\_space\ and related APIs to handle complex colorimetric transformations that were previously unsupported or less accurate.

src/metadata · high confidence

New animation, color, and I/O infrastructure

The library introduces a new animation API with \Frame\, \Frames\, and \Delay\ types to handle animated images, and expands the \ColorType\ and \ExtendedColorType\ enums to support 16-bit and 32-bit float pixel formats (e.g., \L32F\, \Rgba32F\) as well as BGR/CMYK variants. A new \hooks\ module allows registering custom decoding and format-detection hooks for external image formats, while the \io\ module exposes \ImageLayout\ and \DecoderPreparedImage\ to describe image structure before decoding. These changes provide a more flexible foundation for handling diverse image formats and animated content.

src · high confidence

New examples for 1-bit BMP encoding, image conversion, decoding, fractal generation, and opening images

Added five new example programs to demonstrate core image-rs capabilities: bmp\_1bit\_encoding.rs shows how to encode 1-bit BMP files with both default and custom palettes; convert.rs illustrates opening an image and saving it to a different format; decode.rs demonstrates loading an image and accessing its raw byte length; fractal.rs generates a Julia set fractal using num\_complex; and opening.rs shows how to open an image, inspect its dimensions and color type, and save it as PNG.

examples · high confidence

New gradient example demonstrating imageops functions

Added a new example in the examples/gradient directory that showcases the vertical\_gradient and horizontal\_gradient functions from the imageops module. The example generates and saves four PNG images: a vertical gradient, its reverse, and two horizontal gradients, illustrating how to create linear color transitions in images.

examples/gradient · high confidence

New image transformation and processing operations

The \imageops\ module now provides a comprehensive suite of image manipulation capabilities. Users can perform affine transformations including rotating images by 90, 180, or 270 degrees and flipping them horizontally or vertically, with both standard and in-place variants. Color operations have been expanded to include grayscale conversion (with optional alpha preservation), inversion, contrast adjustment, brightness adjustment, hue rotation, and dithering. The module also introduces fast Gaussian blur, advanced sampling filters (Nearest, Triangle, CatmullRom, Gaussian, Lanczos3) for resizing and thumbnailing, and image overlaying with precise coordinate handling. Resizing is now delegated to the \pic-scale-safe\ crate for improved performance and safety, including alpha premultiplication to prevent color bleed.

src/imageops · high confidence

New tile example demonstrates image tiling

An example has been added at examples/tile that shows how to use the image::imageops::tile function to create a tiled wallpaper from an existing image.

examples/tile · high confidence

New utility module for image processing helpers

A new \src/utils\ module has been added to provide internal helper functions for image decoding and manipulation. This includes \expand\_bits\ for unpacking low-bit-depth pixel data, \interleave\_planes\ for combining color channels into standard image formats, and \is\_integer\ for type checking. The module also introduces \vec\_try\_with\_capacity\ for safe memory allocation, \clamp\ for value limiting, and \seek\_start\_with\_offset\ to handle file seeking with overflow protection. These utilities support the underlying image format decoders and are not exposed as public API.

src/utils · high confidence

WebP codec implementation with metadata support and lossless encoding

The WebP codec module now provides a complete decoder and encoder. The decoder supports extracting ICC profiles, Exif, and XMP metadata, handles animated WebP images (including loop counts and background colors), and correctly signals when no more frames are available. The encoder supports lossless WebP encoding for Rgb8, Rgba8, L8, and La8 color types, and allows setting ICC, Exif, and XMP metadata before writing the image.

src/codecs/webp · high confidence

Behavioural changes

Codec module restructure and new format support

The codec implementation has been restructured to use a new initialization pattern based on layout and decoder attributes, replacing the previous \ImageDecoder\ trait methods. This change introduces support for the Farbfeld and QOI image formats, adds CMYK and YCbCr support to the TIFF decoder, and updates the PNG decoder to use stricter XMP detection and improved APNG handling. Additionally, the GIF decoder now supports speed parameters and loop counts, while the OpenEXR decoder has been updated to use a newer library version with relaxed bounds.

src/codecs · high confidence

Expanded PNM fuzzing corpus with comprehensive header and edge-case seeds

The fuzzing input directory for PNM image formats has been significantly expanded with a large set of new seed files generated by the AFL fuzzer. This update includes a new \all\_pnm.pnm\ seed file that explicitly tests all supported PAM header options (including various TUPLTYPEs like GRAYSCALE, RGB, and BLACKANDWHITE with or without alpha), alongside hundreds of other corpus entries. These new inputs cover a wide range of PNM variants (P1, P2, P4, P5, P6, P7) and include edge cases such as malformed headers, unusual whitespace, and binary data, ensuring the fuzzer explores more complex parsing paths and potential crash scenarios.

fuzz-afl/in · high confidence

ICO codec refactored to support multi-frame images and lenient decoding

The ICO decoder and encoder have been rewritten to support multiple images within a single file, allowing users to encode and decode animated or multi-resolution icons. The decoder now includes a 'lenient' mode that tolerates non-standard ICO files, such as those with PNGs other than RGBA or dimensions exceeding 256 pixels, while strict mode remains available for spec-compliant parsing. The encoder API has changed to accept pre-encoded frames via the new \IcoFrame\ struct, enabling more flexible control over the encoding process, and the old \encode\ method is deprecated due to endianness issues.

src/codecs/ico · high confidence

JPEG codec implementation replaced with external crates

The JPEG codec module has been rewritten to use the \zune-jpeg\ crate for decoding and the \jpeg-encoder\ crate for encoding, replacing the previous in-tree implementation. This change introduces new configuration options for users, including the ability to control chroma subsampling modes (4:4:4, 4:2:2, 4:2:0), enable progressive JPEG encoding, and optimize Huffman tables for smaller file sizes. The decoder now supports extracting ICC profiles, Exif, XMP, and IPTC metadata directly from the JPEG stream, and the encoder supports setting pixel density (DPI) information.

src/codecs/jpeg · high confidence

Major overhaul of BMP decoder and encoder with ICC profile and resumable decoding support

The BMP codec module has been significantly refactored to improve robustness, performance, and feature completeness. The decoder now supports reading ICC profiles embedded in BITMAPV4/V5 headers, handles alpha bitfields, and implements lenient decoding modes to tolerate malformed RLE data and other non-spec-compliant files found in the wild. A new resumable decoding API allows processing large images row-by-row without loading the entire file into memory. The encoder has been optimized for performance, hardened against arithmetic overflows, and now supports encoding indexed (palette) images. These changes apply specifically to the BMP codec implementation in src/codecs/bmp.

src/codecs/bmp · high confidence

New math module with Rect type and optimized resize logic

The \src/math\ module introduces a new \Rect\ struct to represent image regions, providing utilities like \from\_xy\_ranges\ for construction and bounds-checking methods (\assert\_in\_bounds\_of\, \shrink\_to\_bounds\_of\) to simplify and secure image cropping and copying operations. Additionally, the module centralizes mathematical helpers, including a new \resize\_dimensions\ function that now correctly rounds resized dimensions instead of truncating them (ensuring non-zero results) and a \multiply\_accumulate\ function that leverages hardware FMA instructions on supported architectures for improved performance.

src/math · high confidence

PNM codec rewritten with new decoder/encoder architecture and 16-bit support

The PNM codec has been completely rewritten to support 16-bit image formats (L16, La16, Rgb16, Rgba16) and PAM images with alpha channels. The new implementation introduces a structured header system that allows for lossless round-trip encoding, meaning images can be decoded and re-encoded with their original format and metadata preserved. The encoder now supports explicit control over the output subtype (Bitmap, Graymap, Pixmap, or ArbitraryMap) and encoding style (ASCII or Binary). Additionally, the decoder has been hardened with stricter validation, including checks for missing header lines, invalid tuple types, and overflow conditions, while the encoder uses an AutoBreak helper to ensure compliant line lengths in ASCII output.

src/codecs/pnm · high confidence

Restructured I/O module with new decoder/encoder traits and format detection

The \src/io\ module has been reorganized into distinct components: \decoder.rs\ defines the \ImageDecoder\ trait with a strict protocol for preparing and reading images, \encoder.rs\ introduces the \ImageEncoder\ trait for writing images with metadata support, and \format.rs\ provides the \ImageFormat\ enum with case-insensitive MIME type matching and extension-based detection. New free functions in \free\_functions.rs\ handle loading and saving, including a magic-byte-based format guesser, while \image\_reader\_type.rs\ offers the \ImageReaderOptions\ builder for flexible decoding with spec compliance modes, and \limits.rs\ enforces strict dimension and allocation limits to prevent resource exhaustion during decoding.

src/io · high confidence

Restructured image core types into the images module

The core image handling types have been reorganized into the \src/images\ module. This change introduces \ImageBuffer\ as the primary generic pixel buffer, \DynamicImage\ as a unified enum for various pixel formats (supporting 8, 16, and 32-bit float depths for Luma, RGB, and Alpha channels), and \SubImage\ for efficient views into image data. Additionally, a new \FlatSamples\ type and \SampleLayout\ struct are provided to handle raw memory buffers with arbitrary strides, facilitating FFI and efficient data access. Parallel iteration support via \rayon\ is also included for pixel enumeration.

src/images · high confidence

TGA codec rewritten with RLE support and stricter validation

The TGA codec has been completely rewritten to improve reliability and performance. The decoder now rejects empty images and validates color map indices to prevent crashes on malformed files, while also correctly handling TGA 2.0 orientation flags and 5-bit-per-primary pixel formats. The encoder adds support for Run-Length Encoding (RLE) to reduce file size for compatible images and validates input dimensions to ensure valid output.

src/codecs/tga · high confidence

Test coverage

1 commit adding/updating tests in tests/regression/tiff; 4 commits adding/updating tests in tests/regression/tga; Add fuzzing harnesses for image formats; Add reference test documentation; Added AFL fuzzing reproducer targets for PNM and WebP formats; Added TGA conformance suite license file; Added fuzzing targets for PNM and WebP image formats; Expanded test coverage for image decoding and metadata; New benchmark suite for image operations and I/O.

Dependencies

375 commits updating dependencies (3 manifests)

A dependency / build maintenance change in (dependencies) — 375 commits (30 fixs), 3 files.

(dependencies) · medium confidence · unverified

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 74 → 67 (-6.9)
  • Rubric changed (rubric-2026.09.10 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 86 → 86 (+0.0)
  • Architecture 100 → 88 (-12.2)
  • Maturity 58 → 58 (+0.7)
  • Readiness 85 → 60 (-24.9)
  • Security 92 → 95 (+2.7)
  • Performance 90 (new)

Resolved (12)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Hotspot: src/codecs/avif/decoder.rs (src/codecs/avif/decoder.rs)
  • Hotspot: src/codecs/bmp/decoder.rs (src/codecs/bmp/decoder.rs)
  • Hotspot: src/codecs/gif.rs (src/codecs/gif.rs)
  • Hotspot: src/codecs/ico/decoder.rs (src/codecs/ico/decoder.rs)
  • Hotspot: src/codecs/png.rs (src/codecs/png.rs)
  • Hotspot: src/codecs/tiff.rs (src/codecs/tiff.rs)
  • Hotspot: src/color.rs (src/color.rs)
  • Hotspot: src/io/format.rs (src/io/format.rs)
  • Hotspot: src/io/image_reader_type.rs (src/io/image_reader_type.rs)
  • Off-boarding risk: anonymized user #1

New (10)

  • Dependency hygiene PARTLY measured — Cargo dependencies read, no committed lock to grade for currency
  • Documentation: contradicts the code (docs/2019-04-23-memory-unsafety.md)
  • Low cohesion: Luma (LCOM4 5) (src/color.rs)
  • Low cohesion: LumaA (LCOM4 5) (src/color.rs)
  • Low cohesion: Rgb (LCOM4 5) (src/color.rs)
  • Low cohesion: Rgba (LCOM4 5) (src/color.rs)
  • Off the main sequence: image
  • Off-boarding risk: anonymized user #1
  • Orphaned files with no living knowledge
  • Projects may be oversized for their cohesion

Changes since last survey

  • 2 commits — 2 feature/other, 0 fixes

By area

  • (repo) — 1 commit
  • (root) — 1 commit

Notable commits

  • change: Merge pull request #3116 from telecos/ci/cargo-deny-miniz-oxide
  • change: ci: Allow duplicate miniz_oxide 0.8

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

image-rs/image was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 29 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 075e65d618a323e5cb48c1d8710a2eca25d690c6 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-5ff527f25b99.