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.

Filter by
Sorted by
Tagged with
62 votes
7 answers
96k views

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, ...
DJSunny's user avatar
  • 1,970
39 votes
13 answers
82k views

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 ...
Wouter Konecny's user avatar
38 votes
6 answers
94k views

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....
DEVOPS's user avatar
  • 18.2k
33 votes
4 answers
46k views

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) ...
Luciano Graziani's user avatar
31 votes
1 answer
7k views

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 ...
ddruganov's user avatar
  • 1,343
29 votes
5 answers
19k views

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 ...
kaese's user avatar
  • 10.2k
29 votes
5 answers
84k views

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 ...
user1016265's user avatar
  • 2,307
27 votes
4 answers
30k views

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 ...
Dennis Haarbrink's user avatar
26 votes
3 answers
7k views

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-...
AZinkey's user avatar
  • 5,229
23 votes
3 answers
19k views

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 ...
Fer's user avatar
  • 4,126
22 votes
3 answers
17k views

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 &...
dynamic's user avatar
  • 47.1k
21 votes
1 answer
24k views

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 ...
ptCoder's user avatar
  • 2,229
21 votes
10 answers
17k views

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->...
fonso's user avatar
  • 325
20 votes
3 answers
31k views

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 ...
Chris Stocking's user avatar
20 votes
2 answers
20k views

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's user avatar
  • 6,038
19 votes
4 answers
24k views

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')...
WASD42's user avatar
  • 2,352
18 votes
9 answers
61k views

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 ...
embe's user avatar
  • 1,094
18 votes
1 answer
1k views

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 ...
BenMorel's user avatar
  • 34.6k
17 votes
3 answers
42k views

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 ...
newworroo's user avatar
  • 399
16 votes
5 answers
52k views

Cannot load imagick library [duplicate]

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 ...
Jamal Abdul Nasir's user avatar
16 votes
4 answers
17k views

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 - ...
Mike Barwick's user avatar
  • 6,318
16 votes
4 answers
3k views

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....
Michael's user avatar
  • 200
15 votes
2 answers
34k views

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 '/usr/local/php5-7.1.9-...
Vive's user avatar
  • 208
15 votes
5 answers
36k views

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 ...
maesk's user avatar
  • 233
15 votes
4 answers
26k views

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: <?php try { $imagick = new Imagick(); $imagick->readImage('C:\xampp\...
Martyn Ball's user avatar
  • 4,689
15 votes
4 answers
4k views

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 ...
Alix Axel's user avatar
  • 152k
15 votes
3 answers
12k views

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. ...
kaese's user avatar
  • 10.2k
14 votes
4 answers
36k views

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's user avatar
  • 7,518
14 votes
4 answers
22k views

Converting .HEIC to JPEG using imagick in C#

I'm having trouble in converting heic file to jpeg I have already tried searching it online, i can find how to write to a folder but not how to get a byte[] of a converted file so that i can save it ...
Comrade404's user avatar
14 votes
1 answer
10k views

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 ...
filip.karas's user avatar
14 votes
3 answers
8k views

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 ...
gregghz's user avatar
  • 3,915
13 votes
7 answers
41k views

PHP-Imagemagick image display

I have php code which create pdf thumbnail as follows; <?php $file ="test.pdf"; $im = new imagick(realpath($file).'[0]'); $im->setImageFormat("png"); $im->resizeImage(200,200,1,0); header("...
Alfred's user avatar
  • 21.1k
13 votes
2 answers
12k views

readimageblob: Fatal Error when converting SVG into PNG

I'm trying to use Image-Magick with PHP to convert SVG text into a PNG image. This SVG is a chart generated with NVD3 and I'd like to allow my users to download it as an image. Basically, I'm sending ...
S P's user avatar
  • 1,801
13 votes
6 answers
16k views

how to resize an SVG with Imagick/ImageMagick

I am sending a string representation of an SVG file to the server and using Imagick to turn this into a jpeg in the following manner: $image = stripslashes($_POST['json']); $filename = $_POST['...
gordyr's user avatar
  • 6,088
12 votes
2 answers
37k views

Imagick: unable to open file

When simply calling the Imagick class: $image = new Imagick('/images/magick/atmsk.png'); I get the error message: Fatal error: Uncaught exception 'ImagickException' with message 'unable to open ...
Dzseti's user avatar
  • 447
12 votes
2 answers
16k views

Imagick don't open pdf files with "Failed to read the file" exception

Trying to open PDF file from php script drop into fault with error: Uncaught ImagickException: Failed to read the file in ... I'm running OS X, Brew, PHP 7.0, php70-imagick --HEAD, ImageMagick --...
o139's user avatar
  • 854
12 votes
4 answers
12k views

center crop with gravity using Imagick and PHP

I'm looking to center crop and image using Imagick PHP apis (not command line version of Imagick). Essentially I want to do what is possible via command line, using API. Here is an example via ...
rynop's user avatar
  • 50.3k
12 votes
7 answers
11k views

Imagick SVG to JPG error no decode delegate

I have tried many different solutions, but cannot use Imagick::readImageBlob, any help would be appreciated. Error message: Caught exception: no decode delegate for this image format `' @ error/blob....
thegingerdk's user avatar
12 votes
1 answer
13k views

PHP Imagick JPEG Optimization

I'm using PHP Imagick to resize images at runtime. The site has an image upload feature and we can't trust the user to use web-friendly JPEGs, as during the mass-import there are many 3 to 5MB images,...
MaKR's user avatar
  • 1,882
12 votes
2 answers
4k views

Outline a transparent image using imagick PHP

I have an image with a transparent background that I'd like to outline with a 5px border. In photoshop, I can stroke it to achieve this. I've tried using borderImage but it won't outline the penguin. ...
steve's user avatar
  • 3,878
11 votes
3 answers
19k views

Homebrew: install new formula php72-imagick

I need install imagick module on my php 7.2 I see brew search php72 ==> Searching local taps... ==> Searching taps on GitHub... ==> Searching blacklisted, migrated and deleted formulae... ...
abkrim's user avatar
  • 3,512
11 votes
2 answers
10k views

Wrap an image around a cylindrical object in HTML5 / JavaScript

I want to wrap an image around a cylindrical object like mugs in a web app, like so This will likely be a base image (e.g. a jpeg image of a mug) containing a transformed image of a user uploaded ...
Yahya Uddin's user avatar
  • 27.1k
11 votes
1 answer
5k views

PHP Imagick setImageOpacity destroys transparency and does nothing

Here's the thing. I hava a simple snippet in PHP like this regarding a transparent image: $im = new Imagick('some-transparent-image.png'); $im->setImageOpacity(0.3); $im->writeImage('output....
Fotis's user avatar
  • 1,332
11 votes
4 answers
34k views

Laravel 5.2: Class Imagick not found

We are converting PDF pages to multiple single images. We found a code snippet in stackoverflow and converted it to a service class. We have Imagick installed and it shows up in phpinfo() as well. ...
IamGhale's user avatar
  • 1,275
11 votes
3 answers
6k views

imagick crash with PHP 5.3

I'm getting this error: The connection to the server was reset while the page was loading. This only occurs when I try to load an image using ImageMagick. <?php header('Content-type: text/...
Daniel's user avatar
  • 578
11 votes
2 answers
12k views

Install imagick on mac

I need to install imagick extension for php. I have already installed Image Magick. Then I did "sudo pecl install imagick". After this I had such output in console: Installing '/usr/include/php/ext/...
user801255's user avatar
10 votes
3 answers
18k views

Using a transparent PNG as a clip mask

Is it possible to take this image: And apply this mask: And turn it into this: Using either GD or Imagick? I know it's possible to mask an image using shapes but I'm not sure how to go on about ...
Jedi's user avatar
  • 121
10 votes
2 answers
6k views

Install imagick extension in Mac OS Catalina : php_imagick.h:42:10: fatal error: 'php.h' file not found

I've followed these steps to install imagemagick and php extension imagick in my computer with Mac OS Catalina and I can't seem to find a way. I always get the following error when trying to install ...
Alvaro's user avatar
  • 40.8k
10 votes
3 answers
4k views

PHP imagick detect transparency

I want to be able to detect whether an image is transparent or not using the Imagick PHP extension. So far, the only luck I've been having is to run the exec() / some other command, and use the ...
Scott's user avatar
  • 101
10 votes
6 answers
4k views

WordPress - Blur Image on Upload

So I'm following the example given here (which I modified to only blur, no watermark), to make a blurred image in WordPress on upload. The problem is, that if the uploaded file is the exact same size, ...
Drew Baker's user avatar
  • 14.2k

1
2 3 4 5
39