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
62
votes
7 answers

Howto: Install Imagick (for php) on Ubuntu 11.10

I'm attempting to install ImagicK as its required for a Yii Extension I want to use for my project. I've checked around and followed a few different suggestions but nothing that has worked so far, ultimately the framework extension is still throwing…
DJSunny
  • 1,970
  • 3
  • 19
  • 27
39
votes
12 answers

ImageMagick Brew installation with PHP Module in Mac OS X

I have installed ImageMagick using brew install imagemagick. This all worked fine and I can run any ImageMagick command from the Terminal / Command line. Now when I try to use the ImageMagick classes in PHP, I get an error Class 'Imagick' not found…
Wouter Konecny
  • 3,260
  • 3
  • 19
  • 26
38
votes
6 answers

How to install Imagick/imagemagick PHP extension on windows 7

How to install image magic in Windows 7. I followed these instruction To install IMagick on Windows XP (php 5.2.x) download and install ImageMagick-6.5.8-7 Q16-windows-dll.exe http://www.imagemagick.org/download/binaries/…
DEVOPS
  • 18,190
  • 34
  • 95
  • 118
33
votes
4 answers

How to install imagick in xampp/wampp in Windows

Today I have tried to install imagick in my xampp a hundred times. And I did it. If you have troubles, please try following these steps: Since xampp is x86, check if your Image Magick (the program) is x86. If not, download the latest version here:…
Luciano Graziani
  • 521
  • 1
  • 8
  • 19
29
votes
5 answers

PDF to JPG conversion using PHP

I'm trying to convert PDF to IMG (JPG) with help PHP. I'm using imagick extension. this is my code $fp_pdf = fopen($pdf, 'rb'); $img = new imagick(); // [0] can be used to set page number $img->readImageFile($fp_pdf); …
user1016265
  • 2,307
  • 3
  • 32
  • 49
29
votes
5 answers

How to stop PHP iMagick auto-rotating images based on EXIF 'orientation' data

Currently working with PHP and iMagick to develop a poster printing Web application. This is the example image I am using to test upload/image editing features of the application: The image contains the following EXIF data: [FileName] =>…
kaese
  • 10,249
  • 8
  • 29
  • 35
28
votes
1 answer

Undefined type 'Imagick' in VSCode's intelephense

I had an issue where I installed Imagick via Pecl and Intelephense didn't know what to do with that extension and failed to show any code completion even though the extension was properly installed in the php.ini file and was working fine. Some…
ddruganov
  • 1,263
  • 13
  • 15
27
votes
4 answers

How to use Imagick to merge and mask images?

I know very little of image processing and even less of the terminology used, so please bear with me. Basically, I want to merge two images together where one of them will act as a mask. That image looks something like this: Where the blue and…
Dennis Haarbrink
  • 3,738
  • 1
  • 27
  • 54
26
votes
3 answers

How to create a large (High Quality 300dpi) image from JSON / array of Data (width,height,x,y,angels) using PHP ImageMagic / Imagick

I created a design (270x470) with some pictures and text on Canvas using FabricJs then i export all pictures/text information in JSON format by fabricJS's canvas.toJSON() method And Now i need to Re-Draw that design on a High Quality (2790x4560)…
AZinkey
  • 5,209
  • 5
  • 28
  • 46
23
votes
3 answers

How to remove exif from a JPG without losing image quality?

I have a PHP photo sharing application in which user-uploaded images are resized into various thumb formats using ImageMagick. As a seemingly "smart" way to save on file size, I am stripping exif info from these thumbs as follow: $imagick = new…
Fer
  • 4,116
  • 16
  • 59
  • 102
22
votes
3 answers

Imagick::resizeImage vs Imagick::scaleImage

What are the differences between resizeImage and scaleImage? I need to resize an image if its size is > $myLimit Example (pseudocode): $myLimit = 1MB user uplaod an image of 1000x1000 of 2MB 2MB > $myLimit while( $imagefilesize > $myLimit ) { …
dynamic
  • 46,985
  • 55
  • 154
  • 231
21
votes
10 answers

Transparent to white in Imagick for PHP

I have a png image with a transparent background and I want to convert it to a jpg image with a white background. The code is basically this: $image = new Imagick('transparent.png'); $image->writeImage('opaque.jpg'); But that creates a black…
fonso
  • 325
  • 1
  • 3
  • 10
21
votes
1 answer

What is the best practice to export canvas with high quality images?

I need your help. I explain my situation: I’m using fabric.js library to place shapes, text, etc. in my application. My canvas size has 1000x1000 pixels (about 26.45x26.45 centimeters). I have an image upload script only for upload images in high…
ptCoder
  • 2,229
  • 3
  • 24
  • 38
20
votes
3 answers

Running ImageMagick on XAMPP 1.8.3 with Windows 7

I have been trying for hours to get ImageMagick working on my localhost (running XAMPP 1.8.3 on Windows 7). I have checked and tried literally every solution that I can find on this website, and dozens of others. Nothing works. No matter what…
Chris Stocking
  • 721
  • 1
  • 5
  • 11
20
votes
2 answers

Convert .psd and .ai to PNG/JPG with imagick

I'm creating thumbnails for a Digital asset manager, what is the best way to do this with imagemagick? is there good resource out there?
Jason Spick
  • 6,028
  • 13
  • 40
  • 59
1
2 3
99 100