Page 1 of 1

how to display db value of ImageMagick 6.3.4's compare

Posted: 2008-10-21T19:47:06-07:00
by joel_tan
i means that how to calculate the db value two different versions of the "same image" indicate how big is difference. Given that compare is used to compare two different versions of the *same image*, and produces a number not only a different image that represents what changed from version to version of the same image,
following is the log info :

bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png tmp.png
compare: image size differs `0b-36643.png'.
bash-3.2# compare -metric MAE 0b-36643.png 0b-36643.png tmp.png
0 (0)
bash-3.2# compare -channel red -metric MAE 0b-36643.png 3a-33504.png tmp.png
compare: image size differs `0b-36643.png'.

the tmp.png can be created but the db value cann't be retrieved in the Solaris
thanks

Re: how to display db value of ImageMagick 6.3.4's compare

Posted: 2008-10-21T19:54:49-07:00
by fmw42
joel_tan wrote:i means that how to calculate the db value two different versions of the "same image" indicate how big is difference. Given that compare is used to compare two different versions of the *same image*, and produces a number not only a different image that represents what changed from version to version of the same image,
following is the log info :

bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png tmp.png
compare: image size differs `0b-36643.png'.
bash-3.2# compare -metric MAE 0b-36643.png 0b-36643.png tmp.png
0 (0)
bash-3.2# compare -channel red -metric MAE 0b-36643.png 3a-33504.png tmp.png
compare: image size differs `0b-36643.png'.

the tmp.png can be created but the db value cann't be retrieved in the Solaris
thanks
if the images have the same width and height, values are returned to the terminal if tmp.png is replaced with null:

compare -metric MAE 0b-36643.png 3a-33504.png null:


see Comparison Statistics section on page http://www.imagemagick.org/Usage/compare/#compare

Re: how to display db value of ImageMagick 6.3.4's compare

Posted: 2008-10-21T20:13:47-07:00
by joel_tan
following is the output in command line :

bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png null
compare: image size differs `0b-36643.png'.
bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png x:
compare: image size differs `0b-36643.png'.
bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png miff:- | display
display: unable to open X server `'.
compare: image size differs `0b-36643.png'.

i also don't get the db value using the compare command . how can i do this ?

Re: how to display db value of ImageMagick 6.3.4's compare

Posted: 2008-10-21T20:27:54-07:00
by fmw42
joel_tan wrote:following is the output in command line :

bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png null
compare: image size differs `0b-36643.png'.
bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png x:
compare: image size differs `0b-36643.png'.
bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png miff:- | display
display: unable to open X server `'.
compare: image size differs `0b-36643.png'.

i also don't get the db value using the compare command . how can i do this ?

You left off the colon ":" at the end of null:

I do not know what db means for you? Do you mean decibels? MAE only give mean absolute error. If you want decibels, you need to use PSNR

Also are you sure the images are exactly the same size in width and height (and also the same number of channels --- is one grayscale and the other truecolor?)

convert 0b-36643.png -format "%w x %h" info:
convert 3a-33504.png -format "%w x %h" info:

check to be sure they both give the same result for width x height

Re: how to display db value of ImageMagick 6.3.4's compare

Posted: 2008-10-21T21:17:14-07:00
by joel_tan
thanks for your help
db value means decibels value

following is the output from compare command:
bash-3.2# convert 0b-36643.png -format "%w x %h" info:
414 x 297
bash-3.2# convert 3a-33504.png -format "%w x %h" info:
417 x 297
bash-3.2# compare -metric MAE 0b-36643.png 3a-33504.png null:
compare: image size differs `0b-36643.png'.

do you mean that the images compared must have the exactly same width and height?
if not , can i get the decibels value?, if so , how can i do this ?
thanks a lot

Re: how to display db value of ImageMagick 6.3.4's compare

Posted: 2008-10-21T21:44:05-07:00
by anthony
joel_tan wrote:do you mean that the images compared must have the exactly same width and height?
if not , can i get the decibels value?, if so , how can i do this ?
thanks a lot
As the pixels are compared directly, IM must know which pixels match which pixels. It can only do this if the images are the same size.

So...
Either you crop a image from identical marker points
Or you size the two images to identically sized images (typically smaller thumbnails for speed of comparing LOTS of images).

PSNR does produce a decibell output. with 0 bein identical and a large number being very different. However as the average of each image is subtracted from each pixel before they are compared, two solid color images of different colors will match identically.

Re: how to display db value of ImageMagick 6.3.4's compare

Posted: 2008-10-21T22:25:24-07:00
by joel_tan
thanks, i can do it by this way


bash-3.2# convert 3a-33504.png -resize 414x297! 3a-33504-tmp.png
bash-3.2# compare -metric PSNR 0b-36643.png 3a-33504-tmp.png tmp2.png
23.6006