tioga-tours/php-imgfing

Check images on their unique fingerprint and compare them

0.3.0 2021-06-16 10:57 UTC

This package is not auto-updated.

Last update: 2024-04-17 23:41:18 UTC


README

Create fingerprints of images to quickly find duplicates or very similar images. Uses GD or Imagick.

Options

bitSize     Bit size of the fingerprint, multiple of 3, defaults to 300. Means the number of characters
avgColor    Apply a correction based on the diff with the avg color, defaults to 5, the normal avg color is 127. With 5, the average can be adjusted between 122 and 132
adapters    Which adapters to use in this order. Defaults to ['Imagick', 'GD']

Usage

<?php
$imgFing = new ImgFing([]);
$f1 = $imgFing->identifyFile(__DIR__ . '/file.png');
$f2 = $imgFing->identifyString(file_get_contents($uri));

echo $imgFing->matchScore($f1, $f2);