Page 1 of 1

compare -metric fuzz is wrong!

Posted: 2011-01-31T19:26:32-07:00
by anthony
The compare -metric fuzz is suposed to implement the FUZZ formula

"%[fx:(100)*sqrt( ( (u.r-v.r)^2 +
(u.g-v.g)^2 +
(u.b-v.b)^2 )*u.a*v.a/3 + (u.a-v.a)^2 ) ]%%"

That is a 4 dimentional cone with alpha channel of the 3D color channel distance.
the 100 (for percent should be QuantumRange for the output image.

See http://www.imagemagick.org/Usage/bugs/fuzz_distance/

However it is clearly not using that formula...

compare -metric fuzz xc:white xc:blue null:
43690 (0.666667)

That wrong. This distance is Manhattan (taxi-cab) distance, without squares or square roots!

compare -metric fuzz xc:white xc:blue -alpha on null:
32767.5 (0.5)

That should NOT be the case.
As both colors are opaque the 'fuzz' distance should not change.
Opaque colors do not get further apart when alpha is enabled!