Page 2 of 2

Re: Comparing different-sized images

Posted: 2010-08-14T08:32:32-07:00
by Drarakel
It doesn't seem to work fully in IM v6.6.3-5.
The "-subimage-search" option now gets recognized. But "compare" still does the subimage-search per default. So, it seems that there's no difference at the moment with or without that option?

Re: Comparing different-sized images

Posted: 2010-08-14T09:32:00-07:00
by fmw42
Drarakel wrote:It doesn't seem to work fully in IM v6.6.3-5.
The "-subimage-search" option now gets recognized. But "compare" still does the subimage-search per default. So, it seems that there's no difference at the moment with or without that option?

Works for me on IM 6.6.3.4 Q16 (HDRI) Mac OSX Tiger


compare -metric rmse mandril3.png mandril3_156_22.png mandril_sim.png
compare: image size differs `mandril3.png' @ error/compare.c/CompareImageChannels/155.

compare -metric rmse -subimage-search mandril3.png mandril3_156_22.png mandril_sim.png
0 (0) @ 156,22

Re: Comparing different-sized images

Posted: 2010-08-14T10:11:52-07:00
by Drarakel
Ah, now I see. It seems that the subimage-search is still done partially - but at the end, there's the "image size differs" message instead of the 'normal' results. Was this the intended behaviour?

Can you try it with the bigger images from my first post?

Code: Select all

convert -depth 8 -size 1000x1000 xc:yellow2 y2.png
convert -depth 8 -size 502x505 xc:yellow3 y3.png
compare -metric RMSE y2.png y3.png test.png
Here, I can't wait for the "image size differs" message to come and have to abort the process.
Running with IM v6.6.3-5 Q16, Windows XP. (With the Windows binary of v6.6.3-4, the new option wasn't recognized yet.)

Re: Comparing different-sized images

Posted: 2010-08-14T12:34:32-07:00
by fmw42
Drarakel wrote:Ah, now I see. It seems that the subimage-search is still done partially - but at the end, there's the "image size differs" message instead of the 'normal' results. Was this the intended behaviour?

Can you try it with the bigger images from my first post?

Code: Select all

convert -depth 8 -size 1000x1000 xc:yellow2 y2.png
convert -depth 8 -size 502x505 xc:yellow3 y3.png
compare -metric RMSE y2.png y3.png test.png
Here, I can't wait for the "image size differs" message to come and have to abort the process.
Running with IM v6.6.3-5 Q16, Windows XP. (With the Windows binary of v6.6.3-4, the new option wasn't recognized yet.)

Sorry I had not gone back to the previous page to see your messages. But running your command, it does seem like the test is delayed til the end and should test for image sizes right at the beginning before starting the compare process. This is on Mac OSX Tiger G4 PowerPC (kind of old).

Sorry I aborted after 35 minutes waiting to finish or give error message.

Re: Comparing different-sized images

Posted: 2010-08-14T15:43:20-07:00
by magick
We can reproduce the problem. Look for a patch in ImageMagick 6.6.3.6 Beta by sometime tomorrow.

Re: Comparing different-sized images

Posted: 2010-08-14T20:35:39-07:00
by fmw42
magick wrote:We can reproduce the problem. Look for a patch in ImageMagick 6.6.3.6 Beta by sometime tomorrow.
In IM 6.6.3.6 Q32 HDRI Mac OSX Tiger, the following does not give an error message as was intended about the sizes being dissimilar, but does not produce the output either.

convert -depth 8 -size 1000x1000 xc:yellow2 y2.png
convert -depth 8 -size 502x505 xc:yellow3 y3.png
compare -metric RMSE y2.png y3.png test.png

Same result in Q16 non-hdri

Re: Comparing different-sized images

Posted: 2010-08-15T04:53:37-07:00
by Drarakel
I can't test it on Windows - as the Windows binaries contain version 6.6.3-5 at the moment.

Re: Comparing different-sized images

Posted: 2010-08-15T07:12:29-07:00
by magick
Correct, we'll release the updated Windows binaries in a day or two.

Re: Comparing different-sized images

Posted: 2010-08-15T12:02:42-07:00
by fmw42
magick wrote:Correct, we'll release the updated Windows binaries in a day or two.
Not sure you saw my message above, but there are no error messages. Will that be fixed in 6.6.3.7?

Re: Comparing different-sized images

Posted: 2010-08-15T13:08:23-07:00
by magick
We can reproduce the problem you posted and will have a patch in ImageMagick 6.6.3-7 Beta by sometime tomorrow. Thanks.

Re: Comparing different-sized images

Posted: 2010-08-18T09:14:02-07:00
by Drarakel
On my system (IM v6.6.3-7, Windows XP), compare works good now - with and without the new option.
Thanks!

Re: Comparing different-sized images

Posted: 2010-08-18T10:24:52-07:00
by fmw42
Same for me on Mac OSX Tiger IM 6.6.3.7 (HDRI)

compare -metric RMSE y2.png y3.png test.png
compare: image widths or heights differ `y2.png' @ error/compare.c/CompareImageCommand/950.

Aborts right away now with the error message.



HOWEVER, now I need to modify my scripts that use it to do subimage searches. If I have an old release that was prior to the change, what will happen if I include -subimage-search in the command line? Will it just ignore it or will it abort with an error about unknown command?

I don't have a handy old release to test, but if this cannot be answered without, I will go back to the archives and get one.

If it needs trapping, then there were several releases where it was implemented and did not work correctly. Is there some better way to trap on this command than using the IM version number or testing for the existence of the command -subimage-search?

Re: Comparing different-sized images

Posted: 2010-08-18T14:57:53-07:00
by Drarakel
I can't help you there - but just to confirm your thoughts:
fmw42 wrote:will it abort with an error about unknown command?
With my older IM versions, it's like that (and returns with an exitcode of 1 - at least on Windows). So, the normal behaviour with "unrecognized" options.

Re: Comparing different-sized images

Posted: 2010-08-18T15:42:25-07:00
by fmw42
Drarakel wrote:I can't help you there - but just to confirm your thoughts:
fmw42 wrote:will it abort with an error about unknown command?
With my older IM versions, it's like that (and returns with an exitcode of 1 - at least on Windows). So, the normal behaviour with "unrecognized" options.
I will just go with using the IM version and ignore those interim releases.