Page 1 of 1

Posted: 2006-12-13T11:20:06-07:00
by Bonzo
Yes you can draw text in an arc.

Here is a link to Anthonys new example page with some ideas http://www.cit.gu.edu.au/~anthony/graph ... erspective

Posted: 2006-12-13T16:23:29-07:00
by Bonzo
I do not understand what is happening here and it needs some work - I am short of time tonight.

Code: Select all

<?php

exec("/usr/local/bin/convert -size 500x150 xc:black -fill white -pointsize 35 -gravity center -draw \"text 0,0 'This is some text to bend' \" text.gif");

exec("/usr/local/bin/composite gradiant.gif text.gif -displace 20 curved.gif");

?>
<img src="gradiant.gif"><br>
<img src="text.gif"><br>
<img src="curved.gif"><br>
http://www.rubblewebs.co.uk/imagemagick ... curved.php

Posted: 2006-12-13T21:31:09-07:00
by anthony
The composite -displace function uses a grey image to define a relative displacement to the LOOKUP of the source image.

see IM examples Composite Displacement Maps
http://www.cit.gu.edu.au/~anthony/graph ... /#displace
for details.

Note displacement maps are a lot harder to understand than positional distortion maps.
(see reference in previous message). however it can reference displaced positions outside the source image, which allows it to properly handle 'undefined' pixels. It also lets you adjust the amount of displacement according to the arguments given...

As for your problem. You are displacing using a 'XY' displacement.
You want just a Y displacement. Use -displace 0x20 instead.

PS: you did not give the code you used to generate your gradient :-)

Posted: 2006-12-14T02:35:26-07:00
by Bonzo
I will have another go later Anthony. I am afraid I didn't post the code that generated the gradiant as I cheated and did it with GIMP :?

Re:

Posted: 2007-07-10T07:06:16-07:00
by Ryland
anthony wrote:You want just a Y displacement. Use -displace 0x20 instead.
Do you know what the PerlMagick syntax for this is?

Should be something like:

Code: Select all

$img->Composite(image=>$map,compose=>'Displace',[parameter]=>'0x20',gravity=>'Center');
...except I don't know what the name of [parameter] is supposed to be

Re: Drawing "curved" text?

Posted: 2007-07-10T18:36:00-07:00
by anthony
Ryland wrote:Do you know what the PerlMagick syntax for this is?

Should be something like:

Code: Select all

$img->Composite(image=>$map,compose=>'Displace',[parameter]=>'0x20',gravity=>'Center');
...except I don't know what the name of [parameter] is supposed to be
That sounds about right, though it may not be implemented.
In "composite" the parameter is saved into a composite option called "displace_geometry" however I can not find any usage of that option in
PerlMagick source code.

Looks like you may need to report a bug in the bugs forum.

Re: Drawing "curved" text?

Posted: 2007-07-14T18:57:38-07:00
by Ryland
anthony wrote:That sounds about right, though it may not be implemented.
In "composite" the parameter is saved into a composite option called "displace_geometry" however I can not find any usage of that option in
PerlMagick source code.

Looks like you may need to report a bug in the bugs forum.
I figured it out, actually, the parameter name is "blend". I didn't know which parameter it was, but there was a list of all parameter names on the PerlMagick page, so I just substituted them in one by one until I found the one that worked. For my money, "blend" isn't a very intuitive name for it, but at least it's in there.

Re: Drawing "curved" text?

Posted: 2007-07-15T16:28:36-07:00
by anthony
It makes some sense to me. blend and dissolve are almost the same routine.

Both routines multiplies the alpha channel value of the image with the given factors, then dissolve overlays the source on the destination while blend adds the source on the destination. Blend is symmetrical, while dissolve isn't.

The only other difference is the handling of a single factor. Blend sets the second factor to the inverse of the first, dissolve does not. Dissolve however treats a single factor larger than 100% as meaning dissolve the second image. If both images are filly opaque this difference has little effect on the outcome.

See IM Examples
http://www.imagemagick.org/Usage/compose/#dissolve