So I Googled and found out how to draw an arc: http://www.php.net/manual/en/function.imagearc.php
The only problem is how do I write text $margin pixels from the arc that is curved.
Centre aligned # $degrees.
Here is an example: http://img194.imageshack.us/img194/3667/scan0001fe.jpg
Let me know if this doesn't make sense.
Here is a simple PHP solution found at http://forums.phpfreaks.com/topic/57542-image-manipulation-skewing-text-text-on-a-curve/
You could try this: http://coding.derkeiler.com/Archive/PHP/alt.php/2004-12/0061.html
Imagick has native support for curved text
Related
I can create a polaroid effect with imagick using this code:
$userphoto->polaroidImage(new ImagickDraw(), $angle);
I'd like to add also a caption, but I found no way to to this without using annotateimage.
The closest I got was using:
$im->newPseudoImage(300, 300, "caption:Put your text");
If I add the polaroid effect to it I get what I need, except that I found no way to put the image inside!
Does anyone know a solution for this?
Using imagemagick is so simple as this:
convert -caption "Faerie Dragon" dragon.gif -gravity center
-background black +polaroid anno_polaroid.png
If you need more advanced text drawing capabilities than annotateImage provides the solution is to:
Create a new ImagickDraw object
Do all the text drawing you want in there.
Draw the ImagickDraw over the actual image.
A very basic example is here though it currently doesn't do text.
I was family with GD of any image processing. But I just change to use Imagick because it's faster than GD. But I don't know how to use imagettfbox (GD) to Imagick.
Please help me with example or method of it ^_^
Adding as an answer from the comment above:
This appears to return the bounding box of a character: http://www.php.net/manual/en/imagick.queryfontmetrics.php
I made that picture in PHP GD, But its have a small problem with lines.
The lines you see is created by imageline().
So when I create a line with an angle using it, the lines had some noises.
Sorry for my bad English.
You could possibly try with imageantialias(). Something like
imageantialias($image, true);
which will result a line a little bit better looking than yours.
Is there a way to get PHP imagettftext() font height?
I know that we can get width by imagettfbbox(). Can we get the height too?
Yes, you evidently can simply be looking at the documentation. Scroll down and use your browsers find function to search for the following:
jodybrabec at gmail dot com
Below his name he provides a nice cusotm function for you to use.
(got a link actually right here, no need to use the find function: http://php.net/manual/en/function.imagettfbbox.php#105593)
I would like to script PHP/ImageMagic in order to produce the "shadow" of a given image. Like in this example (done manually in GFXeditor) :
original shadow
alt text http://uppix.net/d/a/f/dc82fce795fc4af20170080b09c9a.png ==> alt text http://uppix.net/8/9/9/b1e9df4b2858c40081771961e028d.png
Note: All the originals images will be on a white background like in the example.
I've check the ImageMagic documentation but I haven't found anything useful yet. Does anyone know if it can be done in PHP/ImageMagic ? If so how ?
Use convert with -threshold option?
EDIT: oops... from PHP? Imagick::thresholdImage?
I wonder if it isn't more like a mask than a shadow? In the context of IM, shadow looks like a blurry copy of the image.
Try the edge detection chapter in the ImageMagick examples.