From: Urban Wallasch Date: Sun, 6 Jun 2021 13:24:24 +0000 (+0200) Subject: * Sped up perceptual hashing by switching from Gaussian to Box blur. X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=11e96905854c41236bd447f4c679e4c8cddf068a;p=imgdupe.git * Sped up perceptual hashing by switching from Gaussian to Box blur. --- diff --git a/README.md b/README.md index f8e2ee6..6871076 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The perceptual hash for an image is calculated by: * flattening the image (merging layers/frames) * transforming the color space to gray scale - * resizing to 16 by 16 pixel while applying Gaussian blur + * resizing to 16 by 16 pixel using box blur * normalizing contrast and brightness * conversion to monochromatic image * interpreting the pixel values as 256 bit hash value diff --git a/db.c b/db.c index 644a350..4990d8e 100644 --- a/db.c +++ b/db.c @@ -47,7 +47,7 @@ static int phash(db_entry_t *p, double blur) { goto ERR2; wand2 = MagickFlattenImages(wand); MagickSetImageColorspace(wand2, GRAYColorspace); - MagickResizeImage(wand2, 16, 16, GaussianFilter, blur); + MagickResizeImage(wand2, 16, 16, BoxFilter, blur); MagickNormalizeImage(wand2); MagickGetImagePixels(wand2, 0, 0, 16, 16, "I", CharPixel, pix); uint64_t h = 0;