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
8
votes
1 answer

Docker + PHP:8.1.1-FPM how to install imagick php extension?

Trying to install imagick for php 8.1.1. On image of my Dockerfile below composer install gives the following error : Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current…
Sam
  • 1,557
  • 3
  • 26
  • 51
8
votes
8 answers

php Imagemagick jpg black background

I have a php script to create jpg thumbnail of pdf as follows; setImageFormat("jpg"); $im->resizeImage(200,200,1,0); // start buffering ob_start(); $thumbnail =…
Alfred
  • 21,058
  • 61
  • 167
  • 249
8
votes
5 answers

How can I wrap text using Imagick in PHP so that it is drawn as multiline text?

The Imagick library in PHP allows you to draw text on top of an image. How can I tell Imagick to wrap the text based upon some bounded text box, so that the words appear as multiline text rather than a single line?
BMiner
  • 16,669
  • 12
  • 53
  • 53
8
votes
1 answer

imagick php 7.2 not setting webp format

I have ImageMagick 6.7.8-9 and cwebp and dwebp (libwebp, libwebp-devel) installed and working as expected from the command line. I have php7.2 installed from webtatic. the problem I'm facing is that php imagick is not wrking with webp extension…
sami
  • 81
  • 1
  • 4
8
votes
1 answer

Get Image ICC Profile with PHP or Imagick

I have been struggling all day with this issue and surprised that can't find any documentation! I am uploading images to a website & would like to extract the name of each images ICC profile & use it in the image description. So far, standard PHP…
20pictures
  • 161
  • 1
  • 7
8
votes
2 answers

Overlay PNG on JPG using Imagick

I have the last few hours tried to get a PNG logo with a transparent background on top of a JPG background. I have tried several ways and with several globals as well, but I do not seem to be able to get the result I want. "First Attempt": $overlay…
MrE
  • 1,124
  • 3
  • 14
  • 28
8
votes
2 answers

set density parameter for imagick with php

I want to convert a pdf page to a png image with Imagick. I tried with PHP, but the image quality was very low.When I tried with command line, the result was perfect. PHP code $im = new imagick( __DIR__ . DIRECTORY_SEPARATOR.$PDFName.'['.$i.']' ); …
dechiffre
  • 83
  • 1
  • 1
  • 5
8
votes
1 answer

Converting Layered .ai to PDF via PHP

I've a .ai file with 2 Layer Groups and I want to pipe them into a .pdf file with layers. I already tried ImageMagick but I can't get the selector. I tried this: exec("convert 'test.ai[0]' output0.png"); exec("convert 'test.ai[1]'…
8
votes
3 answers

php imagick - read image from base64

I am manipulating images with js, and I'd like to save these transformed images. I'm posting this data with ajax: image : canvas.toDataURL('image/jpeg') This way, I get the base64 code for the image, but I can't find a way to read it with…
stamas
  • 397
  • 1
  • 3
  • 16
8
votes
3 answers

how to use imagick annotateImage for chinese text?

I need to annotate an image with Chinese Text and I am using Imagick library right now. An example of a Chinese Text is 这是中文 The Chinese Font file used is this The file originally is named 华文黑体.ttf it can also be found in Mac OSX under…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
8
votes
3 answers

Issue with Imagick and also with phmagick: Postscript delegate failed / No such file or directory

I'm using imagick 3.0.1 and also phmagick (http://www.francodacosta.com/phMagick/download). No matter what, both are giving me the same kind of error when I try to convert a PDF to JPEG. For example: Postscript delegate failed…
Diego Sarmiento
  • 581
  • 3
  • 7
  • 25
7
votes
3 answers

Count pages in PDF file using Imagemagick - PHP

I am using PHP 5 with Apache in my Windows Vista PC. I have Imagemagick already installed and configured. I want to count the total number of pages in a pdf file using imagick. I fount one solution here, but dont know how to open pdf file as text…
Alfred
  • 21,058
  • 61
  • 167
  • 249
7
votes
1 answer

pecl can't find imagick package

I am attempting to install imagick on my mac. I have searched and read a lot...including this excellent write up. However, I am running into an issue with the final step and that is the actual install of the imagick package via pecl. I am receiving…
MichaelB
  • 175
  • 1
  • 10
7
votes
3 answers

How to resize SVG with PHP?

I am trying to resize (increase size) a SVG inside a PHP script and save it as a new SVG. Given SVG is generated by another script. It contains image and texts. I have tried with imagick, but the generated svg is broken, and doesn't include any of…
тнє Sufi
  • 574
  • 2
  • 9
  • 23
7
votes
3 answers

Subtract two images to leave result - PHP

I have two images (both maps) one is a plain map and one is a map that had pins on it. Image one Image Two I'm trying to subtract them from each other so I'm left with just the pins as a transparent png. I've had some success with this and have…
woolm110
  • 1,194
  • 17
  • 27