advanced_image_processing_toolkit 0.3.0
advanced_image_processing_toolkit: ^0.3.0 copied to clipboard
Fast, private, on-device image processing for Flutter. Chainable pipelines on background isolates, live GPU presets, .cube LUTs, face and text redaction, EXIF-safe output and ML Kit detection.
Changelog #
All notable changes to the Advanced Image Processing Toolkit are documented in this file.
0.3.0 - 2026-11-20 #
A rebuild of the processing core. Existing ImageFilters calls keep their
signatures, but they now run on a new engine that is faster, keeps the
format and transparency you give it, and no longer leaks photo metadata.
Added #
ImagePipeline: an immutable, reusable recipe of steps. A run decodes once, applies every step on raw pixels, and encodes once. Consecutive colour steps are fused into a single pass.- Runs on a background isolate (
Isolate.run) on Android, iOS and desktop, so the UI thread never janks. Inline on the web. runSyncfor code already off the main thread,runAllfor batches across several isolates.toJson/ImagePipeline.fromJsonto save and share edit recipes.custom()escape hatch for anypackage:imagetransform.
- Runs on a background isolate (
- 30 operations: brightness, contrast, saturation, hue, temperature, tint, grayscale, sepia, invert, arbitrary colour matrices; exposure (in linear light), gamma, levels, posterize, threshold, auto levels, auto white balance, auto enhance; Gaussian blur, unsharp-mask sharpen, Sobel edges, emboss, pencil sketch; vignette, deterministic film grain, pixelate, Kuwahara, oil paint, watercolour; resize (contain / cover / fill), downscale, rotate, flip, crop, crop to aspect; region redaction; anchored watermarks.
FilterPreset: 12 built-in looks (Vivid, Golden Hour, Harmattan, Faded Film, Matte, Vintage, Dusk, Arctic, Chrome, Verdant, Mono, Noir).ColorMatrix: composable 4x5 matrices in the same convention as Flutter'sColorFilter.matrix..toColorFilter()on matrices, presets and colour-only pipelines gives a GPU live preview that matches export.CubeLut: parse and apply Adobe/Resolve.cube3D and 1D LUTs, with trilinear interpolation and an intensity blend.- Privacy:
ImagePipeline.redact(regions, style: pixelate | blur | fill).ObjectRecognition.redactFromPath()finds faces (and optionally text) with ML Kit and hides them in one call.MetadataPolicy: EXIF is stripped by default;keepWithoutLocationkeeps camera data but drops GPS.maxInputPixels(default 64 MP) rejects oversized images from the header, before any pixel memory is allocated.
- Widgets:
ImageCompareSlider(accessible before/after slider) andDetectionOverlay(draws detections correctly for anyBoxFit, plus a publicmapRecthelper for hit-testing). - Detection:
detectors:parameter to run only the ML Kit detectors you need (they run concurrently and are created lazily),detectFaces,recognizeText, and aDetectedObject.typefield. package:advanced_image_processing_toolkit/engine.dart: the engine without any Flutter dependency, for your own isolates, servers and CLIs.- Typed errors:
ImageProcessingException,UnsupportedImageException,ImageTooLargeException. tool/benchmark.dartandtool/readme_assets/to reproduce the published numbers and images.- New example app, "Toolkit Studio": live presets and adjustments, render with before/after comparison, recipe viewer, export, and on-device redaction.
Changed #
ImageFilters.*now keeps the input format: PNG stays PNG (with its transparency), JPEG stays JPEG. Formats the engine cannot write (WebP, GIF, BMP, TIFF) become PNG if translucent and JPEG otherwise. In 0.2.x every result was a JPEG.- JPEG output defaults to quality 90 (was 100), which makes files several
times smaller with no visible difference. Use
OutputFormat.jpeg(quality:)to choose. - Output no longer carries the input's EXIF block (camera, timestamps, GPS). In 0.2.x every filter except oil painting copied the original EXIF, including the GPS location, into its output.
ImageFiltersno longer calls theadvanced_image_processing_toolkit/filtersmethod channel before every operation. Nothing native ever handled it, so each call paid a failed platform round trip and a warning log.applyOilPaintingnow implements the classic algorithm (the average colour of the most common intensity bucket). 0.2.x picked the brightest bucket, which behaved like a max filter. It is also about 12x faster intool/benchmark.dart.applyVignetteuses a smooth falloff:radiusis where darkening starts andintensityis the darkening at the corners.applyBlurtreats its argument as the Gaussian sigma, as documented, and costs the same at any radius.- Face detection finds smaller faces (5% of the image, was 15%) and uses ML Kit's accurate mode, which matters for redaction.
- Pose landmark
typevalues are the enum name (leftEye), not thetoString()form (PoseLandmarkType.leftEye). - ML Kit dependencies accept both the 0.x line and 1.x line (same Dart API), so apps on Flutter 3.32 to 3.43 keep resolving 0.x while Flutter 3.44+ gets 1.x.
- SDK constraints now state the real minimum (Dart 3.8 / Flutter 3.32, required by ML Kit). 0.2.0 declared Flutter 3.3 but could not resolve on anything below 3.32.
- Web builds pick the web implementations via
dart.library.js_interop, so the package also compiles for WebAssembly. - Android: compileSdk 36, Java/Kotlin target 17, AGP 8 build script.
- The example app targets iOS 15 and enables Swift Package Manager, which the ML Kit 1.x iOS packages require.
- Stricter analysis (
strict-casts,strict-inference,strict-raw-types) andflutter_lints6. - The example asset is 2400 px (732 KB) instead of 36 MP (4.7 MB), which shrinks the published package.
Fixed #
adjustBrightness(bytes, 0.5)produced a pure white image and any negative value produced pure black (the factor was passed topackage:imageas a x50 multiplier). It now shifts brightness as documented.applyWatermarkignoredopacity.applyWatercolorignoredintensity.ObjectRecognition.dispose()left closed detectors behind, so any later detection call failed. Detectors are now recreated on demand.ObjectRecognitionran its detectors one after another; they now run concurrently.- Blurring a transparent PNG darkened its edges; blur is now premultiplied-alpha aware.
Deprecated #
AugmentedRealityandAdvancedImageProcessingToolkit.isARSupported(). The AR channel never had a native implementation, so every call returnedfalsewhatever plugins the app added. They will be removed in 0.4.0.
0.2.0 - 2026-05-19 #
Breaking #
- Android package renamed from
com.example.advanced_image_processing_toolkittodev.godfreylebo.advanced_image_processing_toolkit. Consumers do not need to change their Dart imports; the change is only visible to Android toolchains. ObjectRecognition.detectObjectsnow takes a file path (String) instead ofUint8List. For raw bytes, use the newdetectObjectsFromBytes(bytes, InputImageMetadata)which requires explicit image metadata (ML Kit cannot infer width/height/stride from a buffer). The previous bytes-based call would throw at runtime with zero-valued metadata; this version fixes that.ObjectRecognition.drawDetectionshas been removed. It was a stub that returned the original bytes unchanged. Draw bounding boxes in your own UI layer (e.g.CustomPainter).AR plugins are no longer bundled.arkit_pluginandarcore_flutter_pluginwere always documented as "optional" but in fact pulled into every consumer app. They have been removed from this package's dependencies. To use AR, add them to your own app'spubspec.yaml.
Changed #
- Replaced the umbrella
google_ml_kitdependency with the individualgoogle_mlkit_*packages — significant install-size reduction for consumer apps. Bumped to the latest 0.11–0.15 series. - iOS minimum version raised to 12.0 (required by Google ML Kit).
- Android:
compileSdk→ 34, AGP → 7.4.2, Kotlin → 1.9.0, declarednamespacefor AGP 7+. dart:ioaccess guarded behind conditional imports so the package compiles cleanly on the web.
Fixed #
- Version numbers were inconsistent across
pubspec.yaml, the in-libraryversionconstant, the iOS podspec, andAPI_REFERENCE.md. All now read0.2.0. ObjectRecognition.detectObjectsno longer passesSize(0, 0)andbytesPerRow: 0toInputImageMetadata— these would have thrown on any real device.- README documented
detectFaces,recognizeText,detectPoses,detectSurfaces, and named-parameter filter signatures that did not exist in the source. The README now matches the actual API surface. API_REFERENCE.mdwas stuck on v0.1.2 / v0.0.6 examples and showed non-staticfinal imageFilters = ImageFilters()usage. Fully rewritten against the v0.2.0 API.- Native
getPlatformVersionis now implemented on both Android and iOS; previously the method handler only had TODO stubs forapplyGrayscale/applyBlurandgetPlatformVersionsilently returnednotImplemented. - Removed the parallel duplicate platform-interface and method-channel
files in
lib/src/that shadowed the canonical ones inlib/.
0.1.6 - 2025-12-17 #
Added #
- Geometric transforms:
applyResize,applyRotate,applyCrop,applyFlip. - Watermarking:
applyWatermarkto overlay images. - Colour adjustments:
adjustContrast,adjustSaturation. - Documentation: feature graphic and updated README with new examples.
0.1.5 - 2025-09-10 #
Changed #
- Documentation rewrite with improved structure and tone.
- Updated author information with portfolio link (godfreylebo.dev).
- Better real-world use-case examples in README.
- Updated package description in
pubspec.yaml.
Fixed #
- Documentation consistency across all files.
- Author metadata alignment.
0.1.3 - 2025-04-20 #
Changed #
- Documentation updates and improved examples.
- Improved code organisation and structure.
