Drawing transparent rectangles over image

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
marisonsouza
Posts: 2
Joined: 2011-10-08T01:22:26-07:00
Authentication code: 8675308

Drawing transparent rectangles over image

Post 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????
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Drawing transparent rectangles over image

Post 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
marisonsouza
Posts: 2
Joined: 2011-10-08T01:22:26-07:00
Authentication code: 8675308

Re: Drawing transparent rectangles over image

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