image_hash 1.1.0 copy "image_hash: ^1.1.0" to clipboard
image_hash: ^1.1.0 copied to clipboard

This package allows you to generate hash values from images and compare them to determine similarity,.

example/image_hash_example.dart

import 'package:image_hash/src/enums.dart';

void main() async {
  // Use perceptual hash to compare images
  final hash1 = await HashFn.perceptual.hashFile('test/fixtures/origin.png');
  final hash2 = await HashFn.perceptual.hashFile('test/fixtures/edited2.jpg');

  // 0 means the same image, higher value means more different.
  // You must use the same hash function to compare images
  final distance = hash1.distance(hash2);
  final similarity = hash1.similarity(hash2);

  print('$hash1 <=> $hash2, Distance: $distance, Similarity: $similarity');
}
5
likes
150
points
391
downloads

Documentation

API reference

Publisher

verified publisherlpkt.cn

Weekly Downloads

This package allows you to generate hash values from images and compare them to determine similarity,.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

image

More

Packages that depend on image_hash