EG typically when reading and writing and image in Q16 IM
8bit image file --> 16bit memory --> 8bit image file
metric PAE is Peak Absolute Error -- Which is the largest 'error' distance between individual values, and not the diagonal colorspace distance.
In other words it is a Chebyshev Distance also known as a King's or Queen's distance in the distance a king or queen would move on a chess board.
As such for a black pixel vs a white pixel this is the 0 to 2^Q where Q is typically 16 or 65535. in Q8 that would be 255
Code: Select all
[b]compare xc:black xc:white -metric PAE null:[/b]
65535 (1)
-compare FUZZ will be using the colorspace distance (diagonal) also known as Euclidean distance (or a as the crow flies, distance)
As such the distance should be sqrt(3)*2^Q or roughly 113511 (for the -fuzz threshold).
However "compare" seems to do things a little differently to the -fuzz calculation. Basically it calculated in floating point, and then multiplies this 'normalised' value by Q^16 so it can be stored into the resulting image, in memory, to ensure it does not overflow the image bounds.
Best idea when using compare is to ignore the actual number and only use the floating point value (in parenthesis). So white to black is a floating (normalized) value of 1, same as for PAE.
Code: Select all
compare xc:white xc:black -metric FUZZ null:
65535 (1)
PAE will still get a maximum value distance (255 at Q8 or 65535 at Q16, or 1.0), but FUZZ will have a normalized value sqrt(2) / sqrt(3) or .816
Code: Select all
[b]compare xc:black xc:cyan -metric PAE null:[/b]
65535 (1)
[b]compare xc:black xc:cyan -metric FUZZ null:[/b]
53509.1 (0.816497)
Compare does not provide a Manhatten Distance (Taxicab) Metric (simple addition of the difference of all color channels), but
you can generate such a difference images very easily...
http://www.imagemagick.org/Usage/compare/#difference