yduf / dhash

Fast perceptual image hash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Difference Hash computation

Licensed under the GNU General Public License, version 3. (GPLv3)

Based on idea from article / 2

Behavior

  • try to keep aspect ratio when computing hash
  • use one of these 3 ratio that fit into 64bits: 8x8, 9x7, 10x6
  • rotate image by 90 when needed, to always fit into these ratios.
  • use libvips thumbnail for fast reduction
  • image formats are those supported by libvips
  • output results a one line json for easier script integration

Compiling

Install dependencies:

meson build .
cd build
meson compile

Usage

$ dhash ~/Pictures/*.webp
{"file":"/home/yves/Pictures/6ihqil3250u91.webp","hash":4413131122559126504,"height":7,"rot90":1,"width":9}

About

Fast perceptual image hash

License:GNU General Public License v3.0


Languages

Language:C++ 88.7%Language:Meson 11.3%