How can I overlay 2 binary images to save the white color on Ubuntu?

0

Imagine there're two the same binary images (all pixels are black). And then you take the 1st image and make some of the pixels white (e.g., points (10,10) and (11, 11)) and do the same operation for point (5, 4) of the 2nd image and save the result images as image1.png and image2.png.

The goal is to create the third image (result.png) that will have every pixel as black but 3 points: (5, 4), (10,10), and (11,11) that should be white. How can I do this operation in Ubuntu automatically?

composite looks like a good command to look into. I tried to use composite -blend and then didn't manage to find the correct command to save the white color.

Alex

Posted 2019-03-19T14:40:04.250

Reputation: 3

Answers

1

composite -blend 100x100% image1.png image2.png output.png worked for me.

image1.png image1.png

image2.png image2.png

output.png output.png

See the documentation for more info.

davidmneedham

Posted 2019-03-19T14:40:04.250

Reputation: 1 724