[RESOLVED] Suggestion For Enhancement

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

[RESOLVED] Suggestion For Enhancement

Post by fmw42 »

For reference see the difference processing at viewtopic.php?f=1&t=29823

The idea is to add a new define or threshold argument to compare so that the (red) overlay of where there are differences (in the first output) is thresholded first so as to remove some of the very small differences from the overlay. (No change to the correlation image).

This is not a very high priority for me. Just a nice additional feature to match the kind of processing the OP's js reference is doing, so as to save all the extra additional -compose difference post-processing.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Suggestion For Enhancement

Post by snibgo »

Isn't this already provided by "-fuzz"?

For example:

Code: Select all

convert rose: -evaluate pow 0.9 r.png

compare -metric RMSE  -subimage-search rose: r.png d0.png

compare -metric RMSE  -fuzz 1% -subimage-search rose: r.png d1.png

compare -metric RMSE  -fuzz 3% -subimage-search rose: r.png d3.png
The numbers we get out are the same (because metric RMSE isn't sensitive to fuzz), but the output images d0, d1 and d3.png are different (the numbers of red pixels decreases).
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [RESOLVED] Suggestion For Enhancement

Post by fmw42 »

Good catch, snibgo. I had not connected fuzz with that feature. The only difference is that the image gets muted (lower saturation) before the overlay is added.

Code: Select all

compare -metric rmse -fuzz 5% People.jpg People2.jpg people_compare4.png
Image

But that can be fixed using the lowlight-color:

Code: Select all

compare -metric rmse -fuzz 5% -lowlight-color none People2.jpg people_compare5.png
Image

Unfortunately, adding -alpha off, does not turn off the fully opaque alpha channel. I had to revert to

Code: Select all

compare -metric rmse -fuzz 5% -lowlight-color none People.jpg People2.jpg miff:- | convert - -alpha off people_compare6.png
Image
Post Reply