Page 1 of 1

mixing colors in image magick

Posted: 2018-09-12T06:57:59-07:00
by manit
Here , '<color> circle' denotes circle filled with color <color>

I have an image with orange circles.
Now I want to draw blue circles on that image such that wherever blue overlaps with orange , i should get brown.
I want to do this via command line because my aim is to study regions of overlap.
When I see brown - I will conclude that blue and orange were here (order of occurence is not important).
Which option should I try ?

Currently I am drawing circle on white canvas using
convert blank.png -fill orange -draw 'circle <number>,<number> <number>,<number>' blank.png
When I run
convert blank.png -fill blue -draw 'circle <number>,<number> <number>,<number>' blank.png
It simply hides orange so seeing blue I can't say if orange was there or not.


Thanks.

Re: mixing colors in image magick

Posted: 2018-09-12T07:25:21-07:00
by snibgo
You can make the second colour partially transparent, eg use "rgba(0,0,100%,0.5)" instead of "blue".

Re: mixing colors in image magick

Posted: 2018-09-12T08:39:43-07:00
by manit
That works.

convert -size 510x340 canvas:white blank.png
convert blank.png -fill orange -draw 'circle 170,170 340,170' blank.png
convert blank.png -fill 'rgba(0,0,100%,0.5)' -draw 'circle 340,170 510,170' blank.png

h t t p s : / / i b b . c o / e D V Z C 9 (can't post images)

Do you suggest any other color combination on white background that is more distinguishing between color1,color2 and mixed color ?