image_hashing 0.1.1 copy "image_hashing: ^0.1.1" to clipboard
image_hashing: ^0.1.1 copied to clipboard

A Dart library for generating perceptual hashes (AHash, PHash, DHash, WHash) from images, providing efficient single-image hash computation and comparison.

example/image_hashing_example.dart

import "package:image_hashing/image_hashing.dart";
// import "dart:ffi";
// import "dart:io" show Platform, Directory, File;
// import "package:path/path.dart" as path;

void main() {
  // print(loadImage("example/example_img/cat.png"));
  print(
    loadImage(
      "example/example_img/gray21.512.tiff",
      targetSize: [8, 8],
      isGrayscale: true,
    ),
  );
  // var libraryPath = path.join(Directory.current.path, "dartcv.dll");
  // final dllFile = File(libraryPath);
  // print(dllFile.path);
  // final dylib = DynamicLibrary.open(dllFile.path);
  // print(dylib);
  // final ahasher = AHash(useCV: true);
  final ahasher = AHash(useCV: false);
  print(ahasher);
  final ahash = ahasher.encodeImage("example/example_img/gray21.512.tiff");
  print(ahash);
  // final phasher = PHash();
  // print(phasher);
  // final phash = phasher.encodeImage("example/example_img/gray21.512.tiff");
  // print(phash);
  // final dhasher = DHash();
  // print(dhasher);
  // final dhash = dhasher.encodeImage("example/example_img/gray21.512.tiff");
  // print(dhash);
}
1
likes
160
points
55
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart library for generating perceptual hashes (AHash, PHash, DHash, WHash) from images, providing efficient single-image hash computation and comparison.

Repository (GitHub)
View/report issues

Topics

#photos #images #hash #dart

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

collection, image, logging, path

More

Packages that depend on image_hashing