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
Drawing "curved" text?
I do not understand what is happening here and it needs some work - I am short of time tonight.
http://www.rubblewebs.co.uk/imagemagick ... curved.php
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>
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
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
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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re:
Do you know what the PerlMagick syntax for this is?anthony wrote:You want just a Y displacement. Use -displace 0x20 instead.
Should be something like:
Code: Select all
$img->Composite(image=>$map,compose=>'Displace',[parameter]=>'0x20',gravity=>'Center');
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Drawing "curved" text?
That sounds about right, though it may not be implemented.Ryland wrote:Do you know what the PerlMagick syntax for this is?
Should be something like:
...except I don't know what the name of [parameter] is supposed to beCode: Select all
$img->Composite(image=>$map,compose=>'Displace',[parameter]=>'0x20',gravity=>'Center');
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Drawing "curved" text?
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.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.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Drawing "curved" text?
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
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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/