public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] diff command for images
@ 2008-01-27 13:54 Erik
  2008-01-27 15:10 ` Elias Probst
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Erik @ 2008-01-27 13:54 UTC (permalink / raw
  To: gentoo-user

I need to find the difference between images (like the text-file diff
command, but for RGBA images). I tried "compare A.png A.png
difference.png". This should obviously produce some kind of blank image
because A.png and A.png are the same file, but for some weird reason the
produced difference.png has recognizable content! Is there a fix for
that bug or any other image diff program that is sane?
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] diff command for images
  2008-01-27 13:54 [gentoo-user] diff command for images Erik
@ 2008-01-27 15:10 ` Elias Probst
  2008-01-27 16:00   ` Erik
  2008-01-27 17:11 ` Jens Krahe
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Elias Probst @ 2008-01-27 15:10 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

Am Sonntag, 27. Januar 2008 14:54:15 schrieb Erik:
> I need to find the difference between images (like the text-file diff
> command, but for RGBA images). I tried "compare A.png A.png
> difference.png". This should obviously produce some kind of blank image
> because A.png and A.png are the same file, but for some weird reason the
> produced difference.png has recognizable content! Is there a fix for
> that bug or any other image diff program that is sane?

The easiest way for doing this, is using GIMP.
- Use one layer for each image
- Use the 'Subtract' mode for displaying the second layer

Regards, Elias P.

-- 
A really nice number:
"09:F9:11:02:9D:74:E3:5B:D8:41:56:C5:63:56:88:C0"

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] diff command for images
  2008-01-27 15:10 ` Elias Probst
@ 2008-01-27 16:00   ` Erik
  0 siblings, 0 replies; 6+ messages in thread
From: Erik @ 2008-01-27 16:00 UTC (permalink / raw
  To: gentoo-user

Elias Probst skrev:
> Am Sonntag, 27. Januar 2008 14:54:15 schrieb Erik:
>   
>> I need to find the difference between images (like the text-file diff
>> command, but for RGBA images). I tried "compare A.png A.png
>> difference.png". This should obviously produce some kind of blank image
>> because A.png and A.png are the same file, but for some weird reason the
>> produced difference.png has recognizable content! Is there a fix for
>> that bug or any other image diff program that is sane?
>>     
> The easiest way for doing this, is using GIMP.
> - Use one layer for each image
> - Use the 'Subtract' mode for displaying the second layer
>   
Not sure how to do this. I am not a graphic artist. But I just open it
with "gimp a.png b.png" and press Ctrl-C in one image, switch to the
other and press Ctrl-V. That seems to create a second layer. Then I have
no idea what to do.

A simple command would be useful. I might have to regression-test 1000
images in a svn commit because some of them seem to have been modified
by optipng.
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] diff command for images
  2008-01-27 13:54 [gentoo-user] diff command for images Erik
  2008-01-27 15:10 ` Elias Probst
@ 2008-01-27 17:11 ` Jens Krahe
  2008-01-27 18:07 ` Willie Wong
  2008-01-27 18:46 ` Ralf Stephan
  3 siblings, 0 replies; 6+ messages in thread
From: Jens Krahe @ 2008-01-27 17:11 UTC (permalink / raw
  To: gentoo-user

Am Sonntag, 27. Januar 2008 schrieb Erik:
> I tried "compare A.png A.png difference.png". This should obviously produce 
> some kind of blank image
> because A.png and A.png are the same file, but for some weird reason the
> produced difference.png has recognizable content!
Try "compare -metric AE A.png A.png difference.png"
This gives you the absolute number of diffrent pixels.

http://www.imagemagick.org/script/command-line-options.php#metric

Regards
Jens
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] diff command for images
  2008-01-27 13:54 [gentoo-user] diff command for images Erik
  2008-01-27 15:10 ` Elias Probst
  2008-01-27 17:11 ` Jens Krahe
@ 2008-01-27 18:07 ` Willie Wong
  2008-01-27 18:46 ` Ralf Stephan
  3 siblings, 0 replies; 6+ messages in thread
From: Willie Wong @ 2008-01-27 18:07 UTC (permalink / raw
  To: gentoo-user

On Sun, Jan 27, 2008 at 02:54:15PM +0100, Penguin Lover Erik squawked:
> I need to find the difference between images (like the text-file diff
> command, but for RGBA images). I tried "compare A.png A.png
> difference.png". This should obviously produce some kind of blank image
> because A.png and A.png are the same file, but for some weird reason the
> produced difference.png has recognizable content! Is there a fix for
> that bug or any other image diff program that is sane?

It seems that you do not understand how the compare function works
http://www.imagemagick.org/script/compare.php

The output image is the second image overlaid with a red "mask". The
pixels that are tinted red in the output shows the pixels that differ
from the original one. The ones that are not tinted red are unchanged.
So if you compare A to A, you will get something that looks like A
tinted by white.

What you want is something like

composite A.jpg -compose minus A.jpg Out.jpg

Look at
http://www.imagemagick.org/script/command-line-options.php#compose

to see what composite operators you can use for doing the comparison. 

W
-- 
Heineken (/hnkt/)... since the second millennium B.C., middle kingdom.
           ' '
Sortir en Pantoufles: up 415 days, 16:27
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] diff command for images
  2008-01-27 13:54 [gentoo-user] diff command for images Erik
                   ` (2 preceding siblings ...)
  2008-01-27 18:07 ` Willie Wong
@ 2008-01-27 18:46 ` Ralf Stephan
  3 siblings, 0 replies; 6+ messages in thread
From: Ralf Stephan @ 2008-01-27 18:46 UTC (permalink / raw
  To: gentoo-user

You could also try the pamarith comand of the netpbm package.
It has both -subtract and -difference


ralf
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-27 18:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-27 13:54 [gentoo-user] diff command for images Erik
2008-01-27 15:10 ` Elias Probst
2008-01-27 16:00   ` Erik
2008-01-27 17:11 ` Jens Krahe
2008-01-27 18:07 ` Willie Wong
2008-01-27 18:46 ` Ralf Stephan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox