Questions tagged [imagick]

Imagick is a native php extension to create and modify images using the ImageMagick library. Please upload example images to imgur.com (or other site) if your question is asking why Imagick is not producing the images you are expecting, so that people can reproduce your problem.

Imagick is a PHP extension to create and modify images using the ImageMagick library. There is also a version of Imagick available for HHVM. Although the two extensions are mostly compatible in their API, and they both call the ImageMagick library, the two extensions are completely separate code-bases.

ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF.

The documentation for PHP Imagick is in the PHP Manual. A large number of examples for Imagick with code and the expected output are at PHPImagick.com


Resources :

1893 questions
19
votes
4 answers

Output raw image from Imagick image in PHP

I'm using Imagick lib to do some modifications to original image. Then I'd like to output it directly to browser without saving. Is there a way to do that? I tried to use Imagick::writeImage('STDOUT') (empty output) and 'php://stdout' with error…
WASD42
  • 2,352
  • 6
  • 27
  • 41
18
votes
9 answers

How to install ImageMagick to use with PHP on Windows 7 (3)

There are other threads about how to install Imagick on Windows 7 but no help for me so far. (Maybe problems have came up with more recent versions) I have followed these steps to install: Download and install…
embe
  • 1,094
  • 2
  • 11
  • 25
18
votes
1 answer

Is there a way to tell whether a font supports a given character in Imagick?

I'm using Imagick to generate simple logos, which are just text on a background. I'm usually looping through all available fonts, to present the user with a choice of different renderings for every font (one image per font). The problem is, some…
BenMorel
  • 34,448
  • 50
  • 182
  • 322
17
votes
3 answers

how do i use imagick in php? (resize & crop)

I use imagick for thumbnail crop, but sometimes cropped thumbnails are missing top part of the images (hair, eyes). I was thinking to resize the image then crop it. Also, I need to keep the image size ratio. Below is the php script I use for…
newworroo
  • 399
  • 2
  • 3
  • 9
16
votes
5 answers

Cannot load imagick library

I have installed the imagick from here (ImageMagick-7.0.3-1-Q16-x64-dll) and the dll (TS 32 bit) from here. And also copiend the CORE_RL_* to the C:\xampp\apache\bin BUT still i get the following error when i run the laravel server. ERROR: Warning:…
Jamal Abdul Nasir
  • 2,557
  • 5
  • 28
  • 47
16
votes
4 answers

Saving Each PDF Page to an Image Using Imagick

I have the following php function below that's converting a local PDF file into images. In short, I want each PDF page to be converted to a separate image. The function converts the PDF to an image - but only the last page. I want every page of the…
Mike Barwick
  • 6,288
  • 6
  • 51
  • 76
16
votes
4 answers

Imagick: compose with mask

I try to recreate a script that uses the ImageMagick command "convert" to compose an image. But I want to do the same in PHP using Imagick (version 6.6.2-10). The command is as follows: convert A1.mpc A3.mpc A4.mpc -channel rgba -alpha on…
Michael
  • 200
  • 2
  • 10
15
votes
4 answers

Issues porting PHP/GD wrapper to Imagick

I've recently discovered that Imagick can support color profiles and thus produce images of better quality compared to GD (see this question / answer for more details), so I'm trying to port my GD wrapper to use the Imagick class instead, my current…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
15
votes
3 answers

Get/set DPI with PHP GD/Imagick?

I'm building a Web application that will handle image files that will ultimately be printed, large format. As part of this, I need to get (i.e. read) and set (i.e. change) the DPI of an image file. Is this possible through PHP GD or PHP…
kaese
  • 10,249
  • 8
  • 29
  • 35
15
votes
5 answers

ext-imagick * -> the requested PHP extension imagick is missing from your system

I have trouble installing devisephp for laravel. I am working on the latest version of homestead with php7. when i do composer update i get the following error. Problem 1 - Installation request for devisephp/cms 1.4.* -> satisfiable by…
maesk
  • 233
  • 1
  • 4
  • 11
15
votes
4 answers

Imagick not loading images, with 'NoDecodeDelegateForThisImageFormat' error message

Trying to create a thumbnail, but i'm getting some errors and I have no experience with Imagick. Here is my PHP: readImage('C:\xampp\htdocs\ppa\032.JPG'); $imagick->thumbnailImage(800,…
Martyn Ball
  • 4,679
  • 8
  • 56
  • 126
14
votes
1 answer

Imagick PHP 5.4 extension does not work with relative paths. (windows)

I'm trying to install imagick PHP extension on windows. It was working on PHP 5.2, PHP 5.3 but I have problems with PHP 5.4. Imagick version: ImageMagick-6.7.6-3-Q16-windows-dll. Module is working. I can see imagick in phpinfo(). The problem is,…
filip.karas
  • 596
  • 2
  • 11
  • 27
14
votes
4 answers

php imagick convert PNG to jpg

$image = "[...]"; //binary string containing PNG image $file = fopen('image.tmp', 'wb'); fputs($file, $image); fclose($file); $image = new Imagick('PNG:image.tmp'); $image->thumbnailImage($width,…
rabudde
  • 7,498
  • 6
  • 53
  • 91
14
votes
2 answers

PHP can not load Imagick library - PHP Startup: Unable to load dynamic library

I have High Sierra OS - Version 10.13.6 PHP Version: PHP 7.1.9 when I try to do command php -v always appear error like this: PHP Startup: Unable to load dynamic library …
Vive
  • 198
  • 1
  • 1
  • 12
14
votes
3 answers

ImageMagick -- setImageAlphaChannel not working (php)

So I have this IM command ($plistnew is a list of coords as you'd expect for polygon): convert in.png ( -size 101x101 xc:black -fill white \ -draw "polygon $plistnew" -alpha off \ -crop 101x100+0+1 +repage \ -scale 101x1! ) \ -clut…
gregghz
  • 3,925
  • 7
  • 40
  • 69