Page 1 of 1

Drawing transparent rectangles over image

Posted: 2011-10-08T01:36:22-07:00
by marisonsouza
Hi Folks!

I have an image (png or jpg) and I'd like to draw a transparent yellow rectangle at a coordinate over the image. I've found an example in the imagemagick documentation when they draw a stroke white like over a rose image.. however,i've tried a lot doind something similar and I can't.

Someone could help? Le't me take an example: image.jpg - try to draw a transparent yellow rect on the x10,y10,w=100,h=40 for instance. How????

Re: Drawing transparent rectangles over image

Posted: 2011-10-08T02:17:28-07:00
by Bonzo
You do not say how you are running the code or what version but this will work using windows command:

Code: Select all

convert input.jpg -strokewidth 0 -fill "rgba( 255, 215, 0 , 0.5 )" -draw "rectangle 66,50 200,150 " output.jpg

Re: Drawing transparent rectangles over image

Posted: 2011-10-08T16:21:42-07:00
by marisonsouza
Bonzo! It worked!!! perfect!!! I've just look examples on google and I didn't found anything close it. Thanks thanks!!
I'm using imagemagick 6.5 on CentOS 5.5