Page 1 of 1
Curved dymanic length text on a flower image in background
Posted: 2007-07-16T05:33:55-07:00
by vikrammandal
Hi,
I need to created a curved text on a flower image in the background. The curved text also needs to be rotated in certain direction/angle
Probably I can use Arc Distortion Map method as described in
http://www.imagemagick.org/Usage/distorts/
Or may be -wave is a better option as my text are going to be of dynamic length.
So i guess i first create a text image with transparent background (jpeg don't support transparency) and them combine it with my flower image?
Or is there better approaches ?
And how best to handle dynamic length text.. i guess the width/height would has lot of variance like font, pointsize, number of characters, screen resolution
Thanks a lot in advance for sharing your thoughts.
Re: Curved dymanic length text on a flower image in background
Posted: 2007-08-08T23:38:34-07:00
by anthony
The new -distort Arc method attempts to preserve the aspect ratio of text as much as posible, so if you resize your Dynamic text to the right length then that length
will be preserved when it is arc'ed into a circle.
Better still generate your text at twice the normal resolution (-density 144), arc it
and shrink the result.
Also not that the arced image has a virtual canvas offset, to position the text relative to the center of the arc. That point will never change so if the text length is the same and the arc angle is the same then the text will be in the same position relative to that 'center' point. You could also specify a 'top edge' to scale the text, to fit it to the flower stem even better.
Make sure you have the latest version of IM for all of this. More options are comming.
Re: Curved dymanic length text on a flower image in background
Posted: 2007-08-08T23:52:25-07:00
by vikrammandal
ok. thanks. I see now the IM v6.3.5-5 has been released... the arc thing in the latest version only. Thanks you.
Re: Curved dymanic length text on a flower image in background
Posted: 2007-08-09T18:33:06-07:00
by anthony
I am right now working on improving the distortion function, so things are happening.
The next release of IM will remove the virtual offset from the "-distort" method while
adding to the 'virtual canvas' usage features using "+distort". This however has not been written up in the examples as yet, so give it a week, for the next set of features.
Re: Curved dymanic length text on a flower image in background
Posted: 2007-08-09T21:26:13-07:00
by vikrammandal
Hi Antony, thanks for the great work.
I have tried the distort arc.. and I see some problem of dangling text edges
Here is one of those generated image
http://www.fivee.in/fileadmin/map_11867 ... XfKDv8.png
see both "P" and the last "t"
Code: Select all
C:\ImageMagick/convert E:/typo3temp/map_1186718996_e4bLcFCR8n.png -background none -distort arc 50 E:/typo3temp/map_1186718996_e4bLcFCR8n.png
OS: WinXP
Please advice.
Re: Curved dymanic length text on a flower image in background
Posted: 2007-08-10T00:39:51-07:00
by anthony
You did not tell Im what to do for pixels that 'missed' the image. That is the virtual pixels.
try adding -virtual-pixel background or -virtual-pixel transparent
before the -distort operator. both would mean the same thing in your case.
If you Change your backgound to some other color you can see the outline of the distorted image, just for testing.
You can rotate the result at the same time using (for example)
or set a top-radius (which also controls scaling)
by adding a thrid argument.
Re: Curved dymanic length text on a flower image in background
Posted: 2007-08-10T02:06:42-07:00
by vikrammandal
Worked like a charm!