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
Related
Output only progressive image format with scaleImage() and writeImage() imagemagick functions.
Thanks.
Your question is hard to understand, but I think you want a baseline JPEG and not an interlaced one.
If that is the case, all you need to do is remove the line:
$image->setInterlaceScheme(IMagick::INTERLACE_LINE);
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)
Is there a built-in function in php to add some extra sharpness on images? Like Photoshops unsharp mask?
Yes, the easiest way is to use the phpThumb library. Here is a demo of the sharpen feature:
http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php#x14
You can apparently also use imageconvolution() in the GD library (phpThumb uses either GD or ImageMagick, whichever is available):
http://www.php.net/manual/en/function.imageconvolution.php
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.
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