Evaluation

What was measured, on which pictures and texts, and what the numbers do not show. One run, on 2 December 2026.

The run

Crate
legit-hashes 0.2.0, built in release mode with Rust 1.100.1
Date
2 December 2026. Rows marked * are from the run of 1 December, on version 0.1.0.
Pictures
335 at about 1.5 megapixels and 20 at full size: artworks from the Cleveland Museum of Art's Open Access collection (CC0) and photographs from NASA's image library
Changed copies
7,370: each of the 335 pictures changed 22 ways with Pillow
Different pictures
55,899 pairs, every pairing of two of the 335
Texts
187 passages from 23 Project Gutenberg books in six languages, and 2,214 edited copies of them
Compared with
Python ImageHash 4.3.2, Meta's PDQ reference in C++, blockhash-python, datasketch 2.0.0

The numbers behind every table and drawing on this page are in one file. The program that produced them is not public yet.

What this does not show

Does it compute what it says?

Each definition names an implementation it must agree with, bit for bit, when both are given the same pixels or the same text.

Agreement with the named implementation
Definition Must equal Inputs Differences
average-v1 *ImageHash average_hash8,082 pictures0
difference-v1 *ImageHash dhashthe same0
perceptual-v1 *ImageHash phashthe same0
simhash-v1 *a second implementation, written from the definition337 texts0
pdq-v1Meta's C++ reference, hash and quality score1,065: 355 pictures at three sizes0
blockhash-v1blockhash-pythonthe same 1,0650
minhash-v1datasketch 2.0.0, its default4,802 texts, all 128 values of each0
minhash-legacy-v1datasketch 2.0.0, scheme="legacy"the same 4,8020

pdq-v1 has a second way of computing, in whole numbers, for processors without standard floating point. On 710 of those inputs it gave the same bits as the first: 0 differences.

From whole files the picture changes a little, because each library opens and shrinks a file its own way. Against ImageHash's own phash of the same files, perceptual-v1 was identical on about two files in three and never more than 8 bits away. So hashes stored by another library are close to this crate's, and not interchangeable with them.

How far does a changed copy move?

Each of the 335 pictures was changed 22 ways, and each copy's hash compared with the original's. A dot is the middle copy. The heavy line reaches the point 19 copies in 20 stay within, and the thin line reaches the worst copy.

perceptual-v1, of 64 bits

0 16 32 bits JPEG, quality 95 JPEG, quality 75 JPEG, quality 50 JPEG, quality 30 Twice the size Half the size A quarter the size Brighter Darker More contrast Less contrast Gamma 0.8 Gamma 1.2 Blur, radius 1 Blur, radius 2 Words across it 2% cropped 5% cropped 5% border Turned 1° Turned 3° Mirrored

pdq-v1, of 256 bits

0 64 128 bits JPEG, quality 95 JPEG, quality 75 JPEG, quality 50 JPEG, quality 30 Twice the size Half the size A quarter the size Brighter Darker More contrast Less contrast Gamma 0.8 Gamma 1.2 Blur, radius 1 Blur, radius 2 Words across it 2% cropped 5% cropped 5% border Turned 1° Turned 3° Mirrored

blockhash-v1, of 256 bits

0 64 128 bits JPEG, quality 95 JPEG, quality 75 JPEG, quality 50 JPEG, quality 30 Twice the size Half the size A quarter the size Brighter Darker More contrast Less contrast Gamma 0.8 Gamma 1.2 Blur, radius 1 Blur, radius 2 Words across it 2% cropped 5% cropped 5% border Turned 1° Turned 3° Mirrored
Further right is more bits moved. The right edge of each drawing is a little past half the bits, which is where two unrelated pictures sit. Changes are grouped: saving again, resizing, tone, blur, words stamped across the picture, and changes of shape.
Bits moved: middle copy / 19 in 20 within / worst copy
Change average-v1 * difference-v1 * perceptual-v1 pdq-v1 blockhash-v1
JPEG, quality 950 / 0 / 10 / 1 / 20 / 0 / 20 / 2 / 20 / 2 / 6
JPEG, quality 750 / 0 / 20 / 1 / 40 / 0 / 20 / 2 / 60 / 2 / 8
JPEG, quality 500 / 1 / 60 / 3 / 110 / 2 / 40 / 4 / 80 / 6 / 40
JPEG, quality 300 / 1 / 30 / 3 / 80 / 2 / 42 / 4 / 122 / 7 / 28
Twice the size0 / 0 / 20 / 1 / 20 / 0 / 22 / 10 / 180 / 2 / 2
Half the size0 / 0 / 30 / 1 / 30 / 2 / 26 / 14 / 360 / 2 / 8
A quarter the size0 / 1 / 30 / 1 / 40 / 2 / 212 / 30 / 480 / 2 / 8
Brighter0 / 2 / 41 / 4 / 70 / 2 / 60 / 6 / 160 / 4 / 16
Darker0 / 2 / 51 / 4 / 80 / 2 / 20 / 2 / 60 / 2 / 24
More contrast0 / 2 / 51 / 3 / 60 / 2 / 20 / 4 / 100 / 2 / 24
Less contrast0 / 2 / 51 / 4 / 70 / 2 / 20 / 2 / 60 / 2 / 29
Gamma 0.81 / 3 / 71 / 4 / 92 / 4 / 84 / 10 / 182 / 6 / 12
Gamma 1.21 / 3 / 51 / 4 / 102 / 4 / 44 / 10 / 142 / 6 / 26
Blur, radius 10 / 2 / 61 / 3 / 40 / 2 / 40 / 2 / 40 / 2 / 6
Blur, radius 20 / 1 / 30 / 1 / 40 / 2 / 22 / 6 / 100 / 2 / 6
Words across it1 / 5 / 181 / 3 / 62 / 6 / 1210 / 30 / 628 / 24 / 60
2% cropped2 / 7 / 235 / 9 / 214 / 10 / 1838 / 54 / 7218 / 40 / 76
5% cropped6 / 14 / 2611 / 18 / 2710 / 18 / 2882 / 112 / 14642 / 78 / 104
5% border16 / 37 / 5513 / 22 / 3414 / 20 / 2684 / 110 / 14066 / 110 / 146
Turned 1°1 / 6 / 113 / 10 / 144 / 10 / 1824 / 46 / 7214 / 30 / 67
Turned 3°4 / 12 / 278 / 16 / 2410 / 18 / 2656 / 84 / 13232 / 52 / 76
Mirrored16 / 38 / 5427 / 39 / 4932 / 34 / 38128 / 134 / 138108 / 164 / 200

The first three are of 64 bits and the last two of 256. Saving again and resizing are JPEG and Lanczos; a turned copy keeps its size and gets black corners; the border is black and 5% of each side; the words are white at half strength across the middle.

The same picture, or a different one?

Take every copy whose change keeps the picture's shape within about 2% (6,030 pairs: saving again, resizing, tone, blur, the stamped words, the 2% crop and the 1° turn) and every pair of different pictures (55,899). A cut says "the same" at or under some number of bits. The table gives, for each definition, the cut that got the fewest wrong.

The best cut on these pictures, and where different pictures sit
Definition Bits Best cut Copies missed, of 6,030 Different pictures matched, of 55,899 Closest different pair 1 in 100 different pairs within Middle different pair
average-v1 *6473018601132
difference-v1 *641252291931
perceptual-v1641445102232
pdq-v1256720266108128
blockhash-v1256508662476128

Meta suggests starting pdq-v1 at 31 bits. On these pictures that cut missed 357 of the 6,030 copies (5.9%) and matched none of the 55,899 different pairs. Seeing none in that many puts the true rate under about one in 18,633, and no lower. The closest two different pictures were 66 bits apart.

Size matters to PDQ

pdq-v1 reads fine detail, so a much smaller copy is further from its original than any other ordinary change makes it. These are the quarter-size copies from above, split by how small they ended up:

pdq-v1: bits between a picture and its quarter-size copy, of 256
Copy's longer side Pairs Middle 19 in 20 within Worst
384 pixels or more17581418
256 to 383 pixels28132224
Under 256 pixels132203448

On those same pairs perceptual-v1 moved at most 2 of its 64 bits. Shrinking a picture to 512 pixels before pdq-v1, as Meta's paper suggests for speed, moved the hash by a middle 10 bits (19 in 20 within 18, worst 34).

What does work is one size for everything. When two copies of different sizes were both reduced to 500 pixels first, their pdq-v1 hashes were a middle 2 bits apart at worst, 19 in 20 within 8, never more than 16, and no pair passed 31. So hash one size of every picture, and never compare a hash of an original with a hash of a reduced copy.

Text

minhash-v1 estimates how much of two texts' five-character runs are shared. Over 2,214 edited copies its estimate was off by +0.0002 on average, with a spread of 0.025; the worst was +0.13. Over 5,553 unrelated pairs it was off by +0.0006, spread 0.006. The spread theory allows is at most 0.044.

Telling a lightly edited copy from an unrelated passage, minhash-v1 made no mistake at any length of text in this set. simhash-v1 on five-character runs was close behind on long texts; on texts under 150 characters it missed 1.6% of copies and matched 1.0% of unrelated passages at its best cut. The best cut for minhash-v1 rose with length, from 0.17 for texts under 50 words to 0.55 for texts over 300, so a cut has to be chosen for the length of text you have.

Neither changes a character before hashing. Lower-casing and collapsing spaces first lifted an all-capitals copy from almost no measured overlap to a full match.

Limits the run found

The square beside the crate's name is simhash-v1:9e358cd3b5724a85, the hash of this page's opening sentence, computed by the crate as the page was served. Each page here has its own.