mixing colors in image magick

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
manit
Posts: 92
Joined: 2009-01-30T22:31:26-07:00

mixing colors in image magick

Post by manit » 2018-09-12T06:57:59-07:00

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.

snibgo
Posts: 10818
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: mixing colors in image magick

Post by snibgo » 2018-09-12T07:25:21-07:00

You can make the second colour partially transparent, eg use "rgba(0,0,100%,0.5)" instead of "blue".
snibgo's IM pages: im.snibgo.com

manit
Posts: 92
Joined: 2009-01-30T22:31:26-07:00

Re: mixing colors in image magick

Post by manit » 2018-09-12T08:39:43-07:00

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 ?

Post Reply