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

mixing colors in image magick

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: mixing colors in image magick

Post by snibgo »

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

Re: mixing colors in image magick

Post 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 ?
Post Reply