Search code examples
linuximage-processingimagemagick

Images "intersection" using ImageMagick


How can I get "intersection" of multiple images involving color fuzziness like in the below example (blue denotes common pixels):

fooar

fooar

A A B B C C D D E E

Is it possible with ImageMagick cli or some other tool?


Solution

  • The below command worked for me:

    convert A B -compose difference -composite -fuzz 30% -fill blue -opaque black -fuzz 30% -fill white -opaque white D