Comparing different-sized images
Posted: 2010-08-04T02:22:04-07:00
I first thought that comparing different-sized images doesn't work.. But apparently, it does - and it can create problems sometimes (e.g. when using compare in a script on a large set of files - like here). If the two images differ greatly in size, compare hangs for several minutes (or longer).
(By the way: In the paragraph about "-compose difference", it's still suggested that compare with different-sized images doesn't work at all - perhaps this could be rephrased..)
An example:2010-08-04T11:04:36+02:00 0:00.016 0.000u 6.6.3 Cache Magick[3272]: cache.c/DestroyPixelCache/1606/Cache
destroy
2010-08-04T11:04:36+02:00 0:00.016 0.000u 6.6.3 Cache Magick[3272]: cache.c/OpenPixelCache/4121/Cache
open y2.png[0] (heap memory, 1000x1000 7.629MiB)
2010-08-04T11:04:36+02:00 0:00.063 0.047u 6.6.3 Cache Magick[3272]: cache.c/DestroyPixelCache/1606/Cache
destroy
2010-08-04T11:04:36+02:00 0:00.063 0.047u 6.6.3 Cache Magick[3272]: cache.c/OpenPixelCache/4121/Cache
open y3.png[0] (heap memory, 502x505 1.934MiB)
2010-08-04T11:04:36+02:00 0:00.078 0.063u 6.6.3 Cache Magick[3272]: cache.c/OpenPixelCache/4121/Cache
open y2.png[0] (heap memory, 499x496 1.888MiB)
This is the last message for some time - I usually have to abort the process here. And this is a problem when using compare in a script.
I mean, this ability to compare an image with a potential sub-image is surely helpful in some cases.
But: Is there an option to turn this feature off? If no, then perhaps such an option could be created?
I'm also getting two images in the output GIF with a command like that (if the overall size is smaller and if the sizes of the two images don't differ that much, it doesn't take that long). Is that correct? The first image looks ok, but the second image looks odd - it has only the dimensions of the 'size difference' of the two images (in the above example, this second image would have the dimensions 499x496).
Running IM v6.6.3-2 Q16, on Windows XP.
(By the way: In the paragraph about "-compose difference", it's still suggested that compare with different-sized images doesn't work at all - perhaps this could be rephrased..)
An example:
Code: Select all
convert -depth 8 -size 1000x1000 xc:yellow2 y2.png
convert -depth 8 -size 502x505 xc:yellow3 y3.png
compare -debug cache -metric ae y2.png y3.png test.gif
destroy
2010-08-04T11:04:36+02:00 0:00.016 0.000u 6.6.3 Cache Magick[3272]: cache.c/OpenPixelCache/4121/Cache
open y2.png[0] (heap memory, 1000x1000 7.629MiB)
2010-08-04T11:04:36+02:00 0:00.063 0.047u 6.6.3 Cache Magick[3272]: cache.c/DestroyPixelCache/1606/Cache
destroy
2010-08-04T11:04:36+02:00 0:00.063 0.047u 6.6.3 Cache Magick[3272]: cache.c/OpenPixelCache/4121/Cache
open y3.png[0] (heap memory, 502x505 1.934MiB)
2010-08-04T11:04:36+02:00 0:00.078 0.063u 6.6.3 Cache Magick[3272]: cache.c/OpenPixelCache/4121/Cache
open y2.png[0] (heap memory, 499x496 1.888MiB)
This is the last message for some time - I usually have to abort the process here. And this is a problem when using compare in a script.
I mean, this ability to compare an image with a potential sub-image is surely helpful in some cases.
But: Is there an option to turn this feature off? If no, then perhaps such an option could be created?
I'm also getting two images in the output GIF with a command like that (if the overall size is smaller and if the sizes of the two images don't differ that much, it doesn't take that long). Is that correct? The first image looks ok, but the second image looks odd - it has only the dimensions of the 'size difference' of the two images (in the above example, this second image would have the dimensions 499x496).
Running IM v6.6.3-2 Q16, on Windows XP.