imagick

Imagick - no decode delegate for this image format

北战南征 提交于 2019-12-23 04:45:21
问题 I am trying to convert PNGs to GIF using ImageMagick on my Ubuntu server. I used a PHP code to generate it however when I ran it, I received.. PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format Then I used: convert -list configure , on the libs, I didn't see either gif or png. So I researched a bit more, and found that I should

PHP Imagick outline/contour and sketch

谁都会走 提交于 2019-12-23 04:26:49
问题 I have a problem with getting fine contour of the image . How to do it with PHP Imagick? Input image: Imagick wizard Plan #1 Outline Get image with (more/less) clear, consistent background (for example: white, red or transparent) Remove background if it is set Add outline (specific color) Remove image inside Result: http://i57.tinypic.com/2wg91qx.png Plan #2 Sketch Get image with (more/less) clear, consistent background (for example: white, red or transparent) Remove background if it is set

How to flood fill the frame with a pattern image using imagick php class?

不羁的心 提交于 2019-12-23 03:54:32
问题 I want to flood fill the frame with tiled image instead of color. Currently im using this codes $imagick = new \Imagick('image.jpg'); $imagick->scaleImage(300, 300, false); // Create frame placeholder $imagick->frameimage( 'red','30','30', 30, 0); // Flood fill with color $imagick->floodFillPaintImage('green', 10, '#6e0000',0, 0,false ); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); and the result: but i want a result like this Thank you very much! 来源: https:/

Make part of an image transparent with IMagick/ImageMagick

佐手、 提交于 2019-12-23 02:55:08
问题 I wish to make part (or in fact, several parts) of an image transparent using IMagick, such that I can use it as a mask over a different image. I can't figure out any way of doing this in an simple fashion. So say my starting image is represented as below, where X is any color: XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX Then I want to be able to make certain rectangular regions transparent (so it ends up a bit like a punch-card): XXXXXXXXXXXXX X XXXXXXXXXX X XXXX

How can I scale up an SVG and save as PNG, with PHP without losing quality?

血红的双手。 提交于 2019-12-23 00:49:43
问题 I have a batch of SVG images that I need to resize and then save as PNG, and I'd like to use PHP to do it. Similar questions to mine have been asked but none of the solutions work for me. For example: option A : use PHP to change the width and height attribute of the SVG. problem with A : this seems to work fine but in fact it only increases the canvas size, not the contents of the canvas. I'm not sure if it's important but my SVGs are small graphics that were created with Illustrator, mostly

Imagick on Windows 8 xampp

拟墨画扇 提交于 2019-12-22 10:51:15
问题 I want to install imagick on windows 8 64bit, xampp. I have tried all methods in internet how to solve this problem, but none helped me ( have tried more than 10 methods ). In all results i get error while launching apache. Apache 2.2.21 PHP 5.3.8 Windows 8 64 Latest method i have tried: http://w3facility.info/question/how-to-install-imagemagick-for-php5-35-4-on-windows-8-x64/ In case i change to extension=php_imagick_nts.dll error looks like: The program can't start because php5.dll is

Add round corners to a jpeg file

假装没事ソ 提交于 2019-12-22 09:55:38
问题 I am trying to add round corners to a jpeg file, but the problem is that after adding round corners, I am getting a black background color. Somehow I am not able to change it to any other color (white, transparent, red). It just simply shows black background where the image has rounded corners. The code that I am using is: <?php $image = new Imagick('example.jpg'); $image->setBackgroundColor("red"); $image->setImageFormat("jpg"); $image->roundCorners(575,575); $image->writeImage("rounded.jpg"

Cut any shape from image ( Imagik/Gd)

こ雲淡風輕ζ 提交于 2019-12-22 09:55:37
问题 Is there any way to cut any shape from square image in PHP ? Example, I have image with heart shape: Another image in same size like heart. Final image: So my question is there way in PHP to make such effect from two images, or one image ? 回答1: You basically just want to copy the opacity of the heart template into the car picture. So, at the command-line, you would do: convert motor.jpg heart.png -compose copyopacity -composite result.png And in PHP: #!/usr/local/bin/php -f <?php $template

ImageMagick and imagick_type_gen don't recognize added fonts

喜你入骨 提交于 2019-12-22 09:19:43
问题 Ok, I'm running a CentOS server, PHP 5.4.440 and ImageMagick 6.5.4 and I'm trying to add additional fonts, as an example let's say Lobster. Here's what I've done so far: Uploaded Lobster.ttf to /home/myusername/fonts/ From SSH, ran "perl imagick_type_gen > fonts.xml". This resulted in a large font file, but contained NO references to either Lobster.otf or Lobster.ttf Instead, I generated my own type.xml and saved it to /home/myusername/.magick/. Here's the markup: <?xml version="1.0"?>

Pass GD image object to Imagick?

倖福魔咒の 提交于 2019-12-22 08:04:23
问题 I'm generating a barcode with PEAR::Image_Barcode which uses GD, but I need to write that barcode onto a section of a PDF and PHP/Imagick seems to be the easiest way to do that, is there any way to convert a GD image object into something Imagick can work with? 回答1: here we go: ob_start(); Image_Barcode::draw($barcode, 'upca', 'gif'); $couponBarcode = ob_get_contents(); ob_end_clean(); $second = new Imagick(); $second->readImageBlob($couponBarcode) it's writing the image to an output buffer