imagick

ImageMagick: how to draw two strings with different size over image?

你。 提交于 2019-12-10 21:18:08
问题 I want to draw a rectangle with two strings in it. I want the first string to be 15pt size (its a number), second to be 10pt size (the label). It's easy to draw single string with one size to the rectangle, I do it like this: $image = new Imagick('someimage.png'); $draw = new ImagickDraw; $draw->setGravity(Imagick::GRAVITY_CENTER); $draw->setfont(__DIR__ . DS . 'TREBUCBD.TTF'); $draw->setfontsize(15); $draw->annotation(0, 0, '50 points'); $image->drawImage($draw); The idea here is to have "50

imagick convert png to jpg in java with im4java

非 Y 不嫁゛ 提交于 2019-12-10 19:33:18
问题 I need to convert from PNG to JPG. However, iMagick adds a black background to it. I saw this question which is for PHP, and tried to write the same for java like this: // create the a jpg image ConvertCmd cmd = new ConvertCmd(); // create the operation, add images and operators/options IMOperation op = new IMOperation(); op.addImage(brandingURL); op.format("JPEG"); op.composite(); op.background("white"); op.addImage(imageLocation); //op.transparent(); // execute the operation cmd.run(op);

PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format

余生颓废 提交于 2019-12-10 18:55:24
问题 I'm using an AWS EC2 Bitnami AMI : bitnami-lampstack-5.4.11-1-linux-ubuntu-12.04.1-x86_64-ebs (ami-aadf4cc3) I have a php file: <?php $im = new imagick(); $im->readImageBlob(file_get_contents("http://s3.amazonaws.com/bucket/file.jpg")); ?> That gives me the following error: PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `' @ error/blob.c/BlobToImage/361' in /opt/bitnami/apache2/htdocs/index.php:3 Stack trace: #0 /opt/bitnami

How do I change the color of a caption drawn with PHP Imagick's newPseudoImage function?

▼魔方 西西 提交于 2019-12-10 18:32:50
问题 I am creating an image with a caption using the Imagick::newPseudoImage function as follows: $txt = new Imagick(); $txt->setFont("templates/fonts/Gloria.ttf"); $txt->setGravity(imagick::GRAVITY_CENTER); $txt->newPseudoImage( $image_width, $image_height, "caption:" . $text ); This draws a black caption. I want to customize the color of this caption. I know there are other methods of drawing text with Imagick. I need to use the newPseudoImage with caption instead of these other methods because

php imagick setGravity function doesn't work with compositeImage() function

冷暖自知 提交于 2019-12-10 13:09:41
问题 I'm using php Imagick class for a project I try to composite an image changing the gravity of the image What I mean is, I want to composite the target image to middle or to the top center I use .... $imageOrg->setGravity(imagick::GRAVITY_CENTER); //I wrote this for an example, position will be set by the visitor $imageOrg->compositeImage($over, Imagick::COMPOSITE_DEFAULT, 0, 0); .... But either setGravity() or setImageGravity() functions don't work. Please help! 回答1: $imageOrg->compositeImage

Imagick is unable to open DNG images

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 12:00:05
问题 As you can see, the image _IGP4559.DNG exists but Imagick can't open it. JPEG images works just fine. readImage() returns the same error. Here is the image: http://files.patrikelfstrom.se/_IGP4559.DNG I run this in the terminal to rule out all other variables. $ ll /var/www/_IGP4559.DNG -rw-rw-rw- 1 monsun monsun 11841201 May 17 03:37 /var/www/_IGP4559.DNG $ php -a Interactive mode enabled php > new Imagick('/var/www/_IGP4559.DNG'); PHP Warning: Uncaught exception 'ImagickException' with

php imagick, how to make an area transparent

邮差的信 提交于 2019-12-10 10:43:55
问题 I want to make an area transparent within an Imagick object with a specific width, height and a top position. For example I need a transparent area with 30px x 30px from the 15th px to the top but I can't find a way to do it. $canvas1 = new Imagick(); $canvas1->newImage(30,60,'black','png'); Please help. 回答1: You can set the opacity as follows $image->setImageOpacity(0.0); If you set it to 0.0 the image what you have crated will become transparent for more information you can Set opacity in

How to read an SVG with a given size using PHP Imagick?

落爺英雄遲暮 提交于 2019-12-10 09:41:31
问题 I have the following code: $image = new Imagick(); $image->setBackgroundColor(new ImagickPixel('green')); $image->setSize(20,20); $image->readImageBlob(file_get_contents('./some/path/image.svg')); It loads the SVG just fine but the setSize just gets completely ignored. It renders at 550x100, as per it's definition: <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="550px" height="100px" viewBox="0 0 550 100"

Use two different fonts in imagemagick on one line

六月ゝ 毕业季﹏ 提交于 2019-12-09 02:10:26
问题 So i want to draw on my image text lets say in this example "Trevor, 24" But I want to use the font Helvetica for Trevor, and for 24 i want to use the font Arial. But I want it to be on the same line and look like it's one. Is it possible or how would i go about making it so that even if i change the name and age, that i can print it out like this? "Trevor, (Helvetica) 24(Ariel)" I would assume to print them next to eachother, but if someone enters the name longer than Trevor 24 would go over

Where to download iMagick PHP extension VC6 and VC9

自古美人都是妖i 提交于 2019-12-08 15:21:16
问题 I would like to use iMagick with my PHP web page, but I can't find where to download an official PHP extension for Windows compiled with code http://pecl.php.net/package/imagick I found some links on the web like : http://valokuva.org/outside-blog-content/imagick-windows-builds/php53/imagick-2.3.0-dev/ http://dev.freshsite.pl/php-extensions/imagick.html But some PHP extensions are very old and makes Apache crash, others are working. And how can I trust the DLL code inside? Is there a trusted