brendan-duncan/image
50.8
Adequate · 19 September 2026
90.4k
lines of production code
Dart
primary language
1
measurement over time
What this system is
This system is a comprehensive Dart library for loading, saving, and manipulating images across a wide variety of formats, including JPEG, PNG, WebP, TIFF, PSD, and OpenEXR. It provides a rich API for image processing, featuring color adjustments, artistic filters, geometric transformations, and a command-based drawing subsystem with support for masks, blend modes, and text rendering. The library also handles complex metadata such as EXIF and ICC profiles, and supports high-dynamic-range pixel formats and multi-frame animations.
How it got here
2013–2014 — Initial library release and format expansion
20 changes.
This period marks the initial release of the dart\_image library, establishing a comprehensive API for image manipulation, drawing, and filtering. The work focused on building a robust, unified architecture for decoding and encoding a wide variety of image formats, including significant rewrites for JPEG, WebP, and EXR support. It also introduced foundational utilities, test infrastructure, and web-based examples to demonstrate the library's capabilities.
2018–2025 — Comprehensive library rewrite and CLI expansion
25 changes.
This period involved a major architectural overhaul of the image library, introducing a new command-based API, extensive support for high-dynamic-range and low-bit-depth pixel formats, and robust EXIF handling. The work also established a comprehensive command-line interface for image format conversion and introduced background isolate processing to prevent UI blocking. Extensive test suites were added to validate the new core components, drawing operations, filters, and format encoders/decoders.
Features
Add TGA image format support
The library now includes support for reading TGA (Targa) image files. This change introduces a new decoder that parses TGA headers to extract image dimensions, pixel depth, and color map information, supporting various image types including palette-based, RGB, grayscale, and their RLE-compressed variants.
lib/src/formats/tga · high confidence
Add built-in Arial bitmap fonts and font loading support
Users can now render text using built-in 14px, 24px, and 48px Arial bitmap fonts via the new \arial14\, \arial24\, and \arial48\ constants in the \lib/src/font\ directory. The \BitmapFont\ class has been introduced to support loading these fonts from ZIP archives (containing .fnt definitions and PNG images) or plain .fnt files, enabling \drawString\ and \drawChar\ operations without external font dependencies.
lib/src/font · high confidence
Added dump\_app1 diagnostic tool for JPEG Exif analysis
A new command-line utility, dump\_app1.dart, has been added to the tool directory to help diagnose JPEG files with Exif data. This tool parses the APP1 segment of a JPEG file to locate and display Exif metadata, including TIFF endianness, IFD0 entries, and pointers to Exif and IFD1 sub-images. It also attempts to decode the Exif data using the library's built-in parser and reports any discrepancies or warnings, such as IFD1 pointers pointing before the ExifIFD, which can cause issues with other tools like exiftool.
tool · high confidence
Initial release of the dart\_image library
This change introduces the \dart\_image\ library (later renamed to \image\), providing a comprehensive set of tools for loading, saving, and manipulating images in Dart. The library exports a wide range of functionality including decoders and encoders for formats such as JPEG, PNG, GIF, WebP, TIFF, PSD, BMP, PNM, PVR, TGA, and EXR. It also includes a rich API for image processing with filters (e.g., blur, sharpen, sepia, noise), drawing commands (lines, shapes, text), color manipulation, and EXIF data handling.
lib · high confidence
Introduce GIF format support with per-frame palette handling
Added new files (gif\_color\_map.dart, gif\_image\_desc.dart, gif\_info.dart) that implement the core data structures for decoding GIF images, including support for per-frame color maps, image descriptors, and global metadata. This enables the library to parse GIF frames with their own palettes and transparency settings, laying the groundwork for animated GIF decoding.
lib/src/formats/gif · high confidence
New TIFF decoder implementation with expanded format support
The TIFF decoder has been rewritten to support a wider range of image formats and compression methods. Users can now decode 16-bit and 32-bit floating-point images, uint16 palette images, and CMYK images with five channels. The decoder also adds support for JPEG (old) compression and fixes previous issues with LZW, PackBits, and Fax compression modes, ensuring more robust handling of complex TIFF files.
lib/src/formats/tiff · high confidence
New color representation classes and channel ordering support
The color library now includes a comprehensive set of new color classes supporting various bit depths and formats, including 8-bit unsigned integers (ColorUint8), 16-bit signed/unsigned integers (ColorInt16, ColorUint16), 32-bit signed/unsigned integers (ColorInt32, ColorUint32), 16/32/64-bit floats (ColorFloat16, ColorFloat32, ColorFloat64), and packed bit formats (ColorUint1, ColorUint2, ColorUint4). These classes implement a common Color interface with support for normalized values, luminance calculation, and format conversion. Additionally, a new ChannelOrder enum and supporting logic have been added to specify and handle different channel orderings (such as RGBA, BGRA, ARGB) when converting between byte arrays and color representations.
lib/src/color · high confidence
New command wrappers for image transform operations
The library introduces a set of new command classes in the transform pipeline to wrap existing image manipulation functions. These include \BakeOrientationCmd\, \CopyCropCircleCmd\, \CopyCropCmd\, \CopyExpandCanvasCmd\, \CopyFlipCmd\, \CopyRectifyCmd\, \CopyResizeCmd\, \CopyResizeCropSquareCmd\, \CopyRotateCmd\, \FlipCmd\, and \TrimCmd\. Each command exposes specific parameters for its underlying operation, such as \radius\ and \antialias\ for cropping and resizing, \padding\ for canvas expansion, and \interpolation\ methods for resizing and rotation. This allows users to chain these specific image transformations within the command-based workflow.
lib/src/command/transform · high confidence
New command-based drawing API with masking, blending, and antialiasing
The drawing subsystem has been refactored into a set of dedicated command classes (e.g., CompositeImageCmd, DrawCircleCmd, DrawRectCmd, FillCmd) that wrap the underlying image operations. This change introduces several new capabilities for users: most draw and fill commands now support a \mask\ argument to restrict rendering to specific areas, and a \blend\ argument to control compositing modes. Additionally, \drawCircle\ and \fillCircle\ now support antialiasing for smoother edges, \drawRect\ and \fillRect\ support a \radius\ parameter for rounded corners, and \compositeImage\ and \drawPixel\ offer a \linearBlend\ option for improved alpha blending quality in linear color space. The \DrawStringCmd\ also allows nullable x and y coordinates to enable central alignment.
lib/src/command/draw · high confidence
New command-line interface for image format encoding and decoding
This change introduces a comprehensive set of command classes in the \lib/src/command/formats\ directory, enabling users to encode and decode images directly from the command line. The new commands support a wide range of formats including BMP, CUR, EXR, GIF, ICO, JPEG, PNG, PSD, PVR, TGA, TIFF, and WebP. Each format has dedicated commands for both in-memory byte data and file-based operations (e.g., \DecodePngCmd\, \EncodePngFileCmd\). Notably, the GIF encoder now supports configurable dithering kernels and scan orders, while the PNG encoder allows control over compression level and filter type. A generic \WriteToFileCmd\ is also provided to handle output to disk, automatically encoding if only an image object is available. This establishes the core CLI infrastructure for image format conversion and manipulation.
lib/src/command/formats · high confidence
New drawing API with antialiasing, blend modes, and masks
The \lib/src/draw\ module has been migrated to a new drawing API that introduces \BlendMode\ support (including alpha, direct, lighten, screen, dodge, addition, darken, multiply, burn, overlay, softLight, hardLight, difference, subtract, and divide) and optional \mask\ parameters for most drawing operations. New capabilities include antialiased \drawCircle\ and \fillCircle\, rounded \drawRect\ and \fillRect\ via a \radius\ argument, \drawPolygon\ and \fillPolygon\ for complex shapes, and \drawLine\ with configurable \thickness\. The \compositeImage\ function now supports \BlendMode\ and \linearBlend\ for improved alpha blending quality, while \drawString\ and \drawChar\ respect blend modes and masks. Existing functions like \fillFlood\ and \maskFlood\ also support masking.
lib/src/draw · high confidence
New example demonstrating image processing in a separate isolate
Added a new example file (example/main.dart) that shows how to load, resize, and save a WebP image using the image package, specifically executing the command chain in a separate isolate thread via executeThread() to avoid blocking the main UI thread.
example · high confidence
New filter command wrappers with masking support
The library now exposes a comprehensive set of image filter commands in the \lib/src/command/filter\ directory, including color adjustments (AdjustColor, Contrast, Gamma, Exposure), artistic effects (BleachBypass, Sepia, Monochrome, Vignette), distortions (Bulge, Stretch), and halftone/dither patterns (ColorHalftone, DotScreen, DitherImage). A key behavioral addition is that nearly all these filters now accept an optional \mask\ and \maskChannel\ parameter, allowing users to apply effects selectively to specific regions of an image rather than the entire frame.
lib/src/command/filter · high confidence
New filter\_lab example with custom UI styling
Added a new \filter\_lab\ example in the web resources, featuring a dedicated CSS stylesheet (\filter\_lab.css\) that defines a dark-themed interface with a toolbar, sidebar, and custom slider/button components for the user interface.
web/res · high confidence
New image filters and color adjustment capabilities
This update introduces a comprehensive suite of new image filters and color manipulation tools. Users can now adjust color properties including contrast, saturation, brightness, gamma, exposure, and hue via the new \adjustColor\ function, as well as apply specific effects such as grayscale, invert, sepia, vignette, and solarize. Additional visual filters include chromatic aberration, color halftone, dot screen, hexagon pixelate, edge glow, emboss, and drop shadow. The library also adds advanced image processing capabilities like histogram equalization and stretching, HDR to LDR conversion, and the ability to generate normal maps from bump maps. Dithering support has been expanded with multiple kernels (Floyd-Steinberg, Bayer, etc.) and scan orders (raster, serpentine, zigzag, Hilbert).
lib/src/filter · high confidence
New image transformation functions and EXIF orientation baking
The transform library now includes several new capabilities: a \bakeOrientation\ function that rotates images to physically match their EXIF orientation metadata (and clears the EXIF tag); \copyExpandCanvas\ to place an image on a larger canvas with configurable padding, position, and background color; \copyRectify\ to map a source rectangle to the full image size; \copyCropCircle\ for circular cropping with antialiasing; and \trim\/\findTrim\ to automatically crop images based on transparency or color. Additionally, \copyResize\ and \copyResizeCropSquare\ now support rounded corners via a \radius\ argument and antialiasing, and \copyResize\ handles EXIF orientation baking automatically.
lib/src/transform · high confidence
New internal utility library for image processing
The \lib/src/util\ directory now contains a comprehensive set of internal helper classes and algorithms that support the image library's core functionality. This includes platform-agnostic file access abstractions (\\_file\_access.dart\), byte stream handling (\InputBuffer\, \OutputBuffer\), and low-level bit manipulation (\bit\_utils.dart\, \float16.dart\). It also introduces three distinct color quantization strategies—Octree, Neural, and Binary—along with essential geometric and mathematical utilities like line clipping (\clip\_line.dart\), color conversion (\color\_util.dart\), and point arithmetic (\point.dart\). These components provide the foundational logic for image decoding, encoding, and transformation.
lib/src/util · high confidence
New web-based examples and visual tests
The web directory now includes a suite of new interactive examples and visual tests. The \filter\_lab\ example allows users to apply and adjust image filters (such as Sepia, Sobel, and Gaussian Blur) in the browser. The \exr\_viewer\ demonstrates decoding OpenEXR images and converting them to PNG for display. Additional examples include \mandelbrot\ for rendering fractals, \test\_formats\ for visually verifying image decoding, \test\_jpeg\_encoder\ for encoding canvas data, and \web\_test\ for running visual unit tests on core image operations.
web · high confidence
PSD layer effects and structural data parsing
The PSD decoder now parses layer effects (such as drop shadows, inner glows, and bevels) and layer section dividers (folders), exposing these details in the decoded image structure. It also handles layer blending ranges and masks, allowing applications to access the full visual metadata of PSD layers beyond just pixel data.
lib/src/formats/psd · high confidence
Support for APNG animations, cICP color profiles, and physical pixel dimensions in PNG decoding
The PNG decoder now supports Animated PNG (APNG) by introducing frame-level handling with configurable blend and dispose modes, allowing users to decode multi-frame images. It also parses and exposes cICP (Coding-independent Code Points) chunks for accurate wide-gamut and HDR color space representation, and reads physical pixel dimensions (pHYs) to provide precise DPI/resolution metadata. These changes are implemented via new internal data structures (\PngFrame\, \PngCicpData\, \PngPhysicalPixelDimensions\) within the PNG format module.
lib/src/formats/png · high confidence
Unified decoder/encoder architecture and new format support
The image library has been refactored to use a consistent base class architecture for all formats, introducing abstract \Decoder\ and \Encoder\ classes with standardized methods like \startDecode\, \decodeFrame\, and \encode\. This change enables new capabilities including BMP decoding and encoding, ICO and CUR file support, OpenEXR (HDR) decoding, and PNM decoding. Additionally, the GIF encoder now supports configurable dithering and quantization, and the JPEG encoder supports 4:2:0 chroma subsampling.
lib/src/formats · high confidence
Removals
Removal of core image processing library
The \src\ directory has been completely removed, deleting the entire \gd\ library implementation. This eliminates all functionality for creating, manipulating, and encoding/decoding images (including JPEG support via \JpegDecoder\ and \JpegEncoder\) as well as the underlying byte buffer utilities (\\_ByteBuffer\) and image data structures (\Image\).
src · high confidence
Behavioural changes
Command execution now supports background Isolate processing
The library now executes image commands on a separate Isolate thread when running in a Dart VM (IO) environment, preventing UI freezes during heavy image processing. This is implemented via new executor files (\_executor\_io.dart) that spawn isolates for async operations, while the HTML executor runs synchronously. Exceptions thrown during command execution are now properly re-thrown to the caller. The Command class and its sub-commands (CreateImage, Convert, CopyImage, AddFrames) remain the same, but their execution is now routed through this new executor layer.
lib/src/command · high confidence
Complete rewrite of EXIF parsing and editing engine
The EXIF handling library has been completely rewritten to support robust reading, writing, and editing of EXIF data. This change introduces a new internal structure using \IfdContainer\ and \IfdDirectory\ classes to manage IFD blocks, allowing for deep copying and proper handling of nested sub-directories (GPS, Exif, Interop). The new implementation fixes several critical bugs present in the previous version, including crashes on unknown value types, truncation of ASCII strings, and incorrect handling of little-endian data and double values. It also adds support for setting GPS latitude/longitude and their references, and ensures deterministic ordering when writing TIFF headers to prevent offset calculation errors.
lib/src/exif · high confidence
Major image library rewrite with new pixel formats and metadata support
The \lib/src/image\ module has been completely rewritten, introducing a new \Image\ class that natively supports ICC profiles, EXIF data, and multi-frame animations. The pixel data architecture has been expanded to include high-dynamic-range (HDR) formats (float16, float32, float64, int8, int16, int32) and new low-bit-depth types (uint1, uint2, uint4), alongside existing uint8 and uint16 support. The API has been updated to use named arguments for constructors and pixel setters (e.g., \setPixelR\, \setPixelRgb\), and the library now includes built-in support for channel order conversion and various interpolation methods for resizing.
lib/src/image · high confidence
New BMP info parsing and validation logic
The library now includes a dedicated \BmpInfo\ class and \BmpFileHeader\ to parse BMP file structures, handling bitfields, color masks, and palette data. This change introduces strict validation for file signatures and unsupported compression types, throwing \ImageException\ on invalid input, and ensures correct handling of 16-bit and 32-bit color depths with proper alpha channel management.
lib/src/formats/bmp · high confidence
New internal EXR decoder implementation with multi-compression support
The EXR format support in \lib/src/formats/exr\ has been replaced with a new internal implementation that enables decoding of OpenEXR files using multiple compression schemes. This change introduces dedicated internal classes for handling EXR attributes, channels, and parts, alongside specific compressors for RLE, ZIP, PIZ (wavelet), PXR24, and B44 algorithms. The new decoder correctly parses multi-part and tiled EXR structures, supporting various channel data types (uint, half, float) and pixel formats, allowing users to successfully load complex HDR images that were previously unsupported or broken.
lib/src/formats/exr · high confidence
Rewritten JPEG decoder with platform-optimized IDCT and enhanced EXIF handling
The JPEG decoder in \lib/src/formats/jpeg\ has been completely rewritten to improve stability and performance. The new implementation introduces platform-specific quantization modules (\\_jpeg\_quantize\_io.dart\ and \\_jpeg\_quantize\_html.dart\) to bypass JavaScript bit-shift bugs while maintaining native speed, and adds support for RSTn and TEM markers to prevent crashes on malformed images. It also enhances EXIF processing by decoding orientation metadata and applying a \bake\_orientation\ transform to physically rotate images, alongside utilities to decode and inject EXIF data without full image decoding.
lib/src/formats/jpeg · high confidence
Rewritten VP8 lossy WebP encoder and decoder
The VP8 lossy WebP implementation has been completely rewritten to align with the latest libwebp specification. This change introduces a new, modular architecture for the encoder and decoder, including dedicated files for bit reading/writing, arithmetic coding, DSP kernels, and filtering. A key behavioral improvement is the fix for signed arithmetic right shifts on the dart2js backend, ensuring that lossy encoding produces valid bitstreams with correct quality metrics instead of meaningless data. The encoder now supports configurable alpha quality and filtering, and the decoder correctly handles headers, segments, and deblocking filters according to the standard.
lib/src/formats/webp · high confidence
Test coverage
5 commits adding/updating tests in test/\_data/tiff; Added PngSuite license file to test data; Added comprehensive test coverage for image transform functions; Added font rendering tests; Added test coverage for EXIF data handling and injection; Added test coverage for color utilities and quantizers; Added test coverage for image creation and command chaining; Added test data files for PNM decoder; Added tests for Image pixel formats and conversions; Added tests for the filter command; Expanded format test coverage for BMP, CUR, EXR, GIF, ICO, JPEG, PNG, PNM, PSD, PVR, TGA, TIFF, and WebP; Expanded test coverage for color formats and drawing operations; Expanded test coverage for image filter functions; New test infrastructure and command-layer coverage.
Dependencies
Update to image package version 4.10.1 with Dart 3.0 SDK and archive 4.0.9
The image library has been updated to version 4.10.1, raising the minimum supported Dart SDK version to ^3.0.0. The primary dependency, the archive package, has been bumped to ^4.0.9. Dev dependencies for testing, building, and linting have also been updated to their latest compatible versions.
(dependencies) · high confidence
Housekeeping
Initial repository scaffolding and configuration
The repository is initialized with essential configuration files, including a \.gitignore\ to exclude build artifacts and IDE files, a \.pubignore\ to define package publishing boundaries, and an \analysis\_options.yaml\ that enforces strict Dart linting rules. The project also includes a \README.md\ with usage examples, a \LICENSE\ file, and a \build\_web.bat\ script for compiling web assets.
(repo-wide) · high confidence
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
Baseline
- First survey — no prior run to compare against. CAI 51.
Lenses
- Code Health 96
- Architecture 90
- Maturity 56
- Readiness 63
- Security 97
- Domain Modelling 100
- Accessibility 30
Changes since last survey
- 300 commits — 209 feature/other, 91 fixes
By area
- lib/src — 159 commits
- (repo) — 52 commits
- (root) — 36 commits
- test/_data — 10 commits
- test/transform — 8 commits
- test/formats — 7 commits
- lib/image.dart — 5 commits
- test/filter — 5 commits
- test/_test_util.dart — 4 commits
- doc/filters.md — 3 commits
- doc/tutorial.md — 3 commits
- doc/fonts.md — 1 commit
- doc/images — 1 commit
- test/command — 1 commit
- test/draw — 1 commit
- test/image — 1 commit
- tool/dump_app1.dart — 1 commit
- tools/dump_app1.dart — 1 commit
- web/filter_lab.dart — 1 commit
Notable commits
- fix: Add PNM/TGA detection regression test (#744)
- fix: Animated webp fixes
- fix: Fix APNG decoding
- fix: Fix GIF decode crash when frames use different local palettes; add regression test with palette_remap.gif in test data
- fix: Fix TIFF out of bounds error
- fix: Fix VP8L lossless decode blank with subtractGreen transform
- fix: Fix a batch of triaged issue-tracker bugs
- fix: Fix adjustColor color corruption
- fix: Fix alpha color handling for jpeg encoder
- fix: Fix analysis
- fix: Fix analysis errors
- fix: Fix analyzer
- fix: Fix analyzer
- fix: Fix bmp encoder when image has no palette
- fix: Fix compatibility issues with archive 3.x
- fix: Fix copyCrop for animated images
- fix: Fix decodePnmFile using Png instead of Pnm
- fix: Fix drawString making new line for |
- fix: Fix error with drawPixel mask
- fix: Fix exception loading some PSD images
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
brendan-duncan/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 19 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 ca4d0aa5fc4a31b8410bbfbb7f663f8da3643eea — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.