Skip to content
pubscout

image_compare

1.1.2, released 5 years ago by an unverified publisher

Compare two images for visual differences using multiple algorithms

$ flutter pub add image_compare
Source repository

What it does

image_compare lets you compare two image sources (URL, file, bytes, or Image object) and returns a percentage difference. It supports several algorithms such as pixel matching, Euclidean color distance, histogram methods, and perceptual hashing. The package handles resizing, optional alpha channel handling, and works on all major platforms.

AI-written summary of version 1.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to detect visual differences between images in tests or CI pipelines
  • You want to compare images for similarity or exactness in a Dart/Flutter app
  • You need a pure Dart solution without native dependencies

Skip it when

  • You only need a simple equality check of image bytes
  • You require high-performance GPU-accelerated comparison
  • You are building a UI component that displays image differences

Strengths

  • Multiple comparison algorithms with configurable options
  • Pure Dart implementation, no native code required
  • Supports all major platforms via universal_io
  • Handles transparency with ignoreAlpha option

Weaknesses

  • No built‑in UI for visualizing differences
  • Performance may be slower for large images
  • Limited to image comparison, no other image processing features

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Add dependency to pubspec and import 'package:image_compare/image_compare.dart'; no special permissions needed

var a = Uri.parse('https://example.com/image1.png');
var b = File('assets/image2.png');
var result = await compareImages(src1: a, src2: b, algorithm: PixelMatching());

Alternatives

Packages that do the same job and could replace image_compare.

Works with

Packages commonly used together with image_compare: ones it builds on, ones built on it, and its own family.