Page 1 of 1

Creating a label with text and rounded corners

Posted: 2011-05-13T15:25:13-07:00
by troyd1
I have 6.6.9-7. q16 dynamic - window 2003 server
I want to put text on an existing image with a white background. I used label, but that creates a box. I would like rounded corners. I could use the draw roundrectangle and then put the text inside, but I want it to have it size itself to fit the text as label does when you give it a height only. After I get that to work, I would also like to be able to have the white box wash into the graphic instead of just being like an overlay. Any ideas?

Thanks in advance for any help.

Re: Creating a label with text and rounded corners

Posted: 2011-05-13T16:39:32-07:00
by fmw42
create your text using label: on a white background. then get the dimensions of the image. then create a new image slightly larger with rounded corners (enough larger to accommodate the rounding). then composite your text image in the center of the round rectangle. then composite that over your background image.

Re: Creating a label with text and rounded corners

Posted: 2011-05-14T01:11:03-07:00
by Bonzo
Check out Anthony's example for rounded corners here:
http://www.imagemagick.org/Usage/thumbnails/#rounded

The section above it shows how to blur the edges and you can probably combine the two.

Re: Creating a label with text and rounded corners

Posted: 2011-05-15T05:38:42-07:00
by anthony
Bonzo wrote:Check out Anthony's example for rounded corners here:
http://www.imagemagick.org/Usage/thumbnails/#rounded
There are quite a number of methods for doing rounded corners listed in that section, each with some advantages and disadvantages. Some can be extended to even fancier corner and edge handling.

Re: Creating a label with text and rounded corners

Posted: 2011-05-20T09:04:44-07:00
by troyd1
Thanks, Great stuff!