compare, but ignore defined color pixels

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
michiS
Posts: 2
Joined: 2011-09-22T02:50:09-07:00
Authentication code: 8675308
Location: Rottweil, Germany

compare, but ignore defined color pixels

Post by michiS »

Hi,
im looking for the command of comparing two images, but ignore the pixels of a defined color (f.e. black) from my reference pic.
So i have a reference pic. In this pic i put some parts to f.e. black or blue. At the comparison, these pixels should not be seen as different pixels (ignored).
Is there any possibility in the compare command?
compare -metric AE -subimage-search big.png reference.png result.png

Thanks, Michael
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: compare, but ignore defined color pixels

Post by fmw42 »

I don't know if any of the metrics ignore transparent pixels, but that would be the only way that it might work.

The IM developers would have to say for sure. It would be a nice feature to add if it does not already exist.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: compare, but ignore defined color pixels

Post by anthony »

I believe only the fuzz metric does as it used the same 'fuzz' factor test as color substitution.

I have not played with it much at this point though.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
michiS
Posts: 2
Joined: 2011-09-22T02:50:09-07:00
Authentication code: 8675308
Location: Rottweil, Germany

Re: compare, but ignore defined color pixels

Post by michiS »

Ok thanks, but it is not really what im looking for. I think it would be a new feature. In my case it is not really easy, because most of the imagepixels have a partly transparency. I will play a bit with the fuzz factor.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: compare, but ignore defined color pixels

Post by anthony »

michiS wrote:Ok thanks, but it is not really what im looking for.
Any specific reason why not? Have you tried setting -fuzz and -metric fuzz

Any specific reason blue and black should be thought of as being equivalent?

For example could you ignore blue channel and only do compare against red and green channels.

Or is it because they are dark, or is blue irrelevant just as you want transparency to be irrelevant.

A little more information, could let us would out some pre-processing of the images to ignore these things. That is make them the same before the compare.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply