Page 1 of 1

transparent roundrectangle and composite

Posted: 2007-11-03T02:49:31-07:00
by complete_beginner
Hello,

I'm preparing some teaching material for the students in regards to a Linux Shell. I got a screen shots of Linux terminal which is black letters on white background.
Image
http://cyberwar.netfirms.com/test.gif
I'm more sys admin that graphic designer so I spend couple hours to find out how can I place transparent yellow roundedrectangle over my image.
As suggested on this forum, before a placed this question to the forum I have done some research and I found:
http://www.imagemagick.org/Usage/compose/#blend_use
however if covers the whole image. So I have tried to create rectangle first and that use composite and I ended with this:

Code: Select all

convert -size 500x25 xc:yellow rec.png   
composite -compose over -gravity center rec.png test.gif test_.gif

Image
http://cyberwar.netfirms.com/test_.gif
how do I make this yellow rectangle round and transparent so I can see what is behind it? Any hints are appreciated.

thank you

Re: transparent roundrectangle and composite

Posted: 2007-11-03T02:55:17-07:00
by Bonzo
Your host will not allow your image links !

Is this what you are trying to do ?
Image

Code: Select all

convert -size 637x140 xc:none -fill white -draw "roundRectangle 0,0 637,140 15,15" albir.jpg -compose SrcIn -composite rounded_corners.png

Re: transparent roundrectangle and composite

Posted: 2007-11-03T03:22:47-07:00
by complete_beginner
Hello Bonzo,

Thank you for your reply. Can you please try this link:
http://cyberwar.netfirms.com/test.html

basically I would like to make that yellow rectangle round so it does not reach both ends of a background image and also that yellow rectancle should be transparent.

let me know if you still can see my images.

thank you

Re: transparent roundrectangle and composite

Posted: 2007-11-03T03:54:36-07:00
by Bonzo
I can see you images now.

I tried to get this all onto one line of code but it didn't work so I have created the yellow image seperatly. If you are going to be doing quite a lot of "highlighting" it would be quicker to have the mask already on the server anyway and call it up.

Code: Select all

convert -size 500x25 xc:none -fill yellow -draw "roundRectangle 0,0 484,10 3,3" mask.png
composite -blend 60 -gravity center mask.png http://cyberwar.netfirms.com/test.gif -matte output.jpg
Image

Re: transparent roundrectangle and composite

Posted: 2007-11-03T04:15:44-07:00
by complete_beginner
great this is exactly what I wanted.

Thank you for your help. :D