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

How to overlay an image on top of another image using iMagick

Overview: I got two images. The background image with 1920x1080p resolution and the overlay image that can be of any resolution less than 1920x1080p. Background image(1920x1080): Overlay image:(any size less <= 1920x1080) Result…
Kiran Dash
  • 4,816
  • 12
  • 53
  • 84
7
votes
1 answer

PHP Imagick Won't Read SVG file

When I try to load an SVG file, I get this error message Fatal error: Uncaught exception 'ImagickException' with message 'unable to open file `/tmp/magick-aWsnhHLT': No such file or directory @ error/constitute.c/ReadImage/583' in…
Brian Leishman
  • 8,155
  • 11
  • 57
  • 93
7
votes
7 answers

Imagick php windows

I am trying to use iMagick in Symfony2. I am using PHP 5.4.16 and all i have done : 1-Copy php_imagick_nts.dll from php5-4 directory from the extracted http://valokuva.org/~mikko/imagick-php54-php53.tgz to php/ext . 2-Rename it to php_imagick.dll…
ABS
  • 2,626
  • 3
  • 28
  • 44
7
votes
1 answer

How to save an Imagick object (php)

I guess it's a silly question, but it's my first time to deal with php and image handling. In short I wonder how I can save the image instead of echoing it on a web page. The code is for distorting image which might not be in important in this…
Arch1tect
  • 4,128
  • 10
  • 48
  • 69
7
votes
4 answers

PHP extensions not loading in phpinfo

So I'm running MAMP on Mountain Lion and I've installed gmagick and imagick using pecl, both are relase candidates (mainly because gmagick doesn't have a stable release and imagick 3.0.0 doesn't install, it gives a make error). The modules appear…
Vidi
  • 183
  • 1
  • 1
  • 9
7
votes
2 answers

Convert PDF to high quality JPG using PHP and ImageMagick

I'm tearing my hair out. I have a 300 DPI PDF that I want to turn into a 300 DPI JPG that's 2550x3300. I am told ImageMagick can do this, so I get ImageMagick to work, but it only returns a JPG that is sized about 1/5 the original PDF size. It's…
Brian Mayer
  • 989
  • 3
  • 13
  • 23
7
votes
1 answer

php imagick setGravity function doesn't work with compositeImage() function

I'm using php Imagick class for a project I try to composite an image changing the gravity of the image What I mean is, I want to composite the target image to middle or to the top center I use .... $imageOrg->setGravity(imagick::GRAVITY_CENTER);…
Onur Kucukkece
  • 1,708
  • 1
  • 20
  • 46
6
votes
2 answers

How to set the trimming color in Imagick?

I am trying to remove transparent areas of an image with php using imagick. Image Magick provides the trim method: Imagick::trimImage Remove edges that are the background color from the image. This method is available if Imagick has been compiled…
jantimon
  • 36,840
  • 23
  • 122
  • 185
6
votes
1 answer

Imagick max resource differs in php script from php commandline

I've changed my policy.xml to allow a larger max image sizes. When running the script in command line: $ php image.php 64000 But then when I load it in the browser: 16000 The script simply contains:
Jam3sn
  • 1,077
  • 4
  • 17
  • 35
6
votes
5 answers

User name as Watermark

Ok, I searched the internet and stackoverflow but I just can't seem to find an answer for my problem. I need to watermark images uploaded by users dynamically, but I don't want just text applied on an image. I need a real watermark like this: The…
moonwalker
  • 485
  • 2
  • 6
  • 20
6
votes
1 answer

"Imagick::flattenImages method is deprecated and it's use should be avoided"

i cant use flatternImages() function becouse it's deprecated. I must use $im->setImageAlphaChannel(\Imagick::ALPHACHANNEL_REMOVE); $im->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN); But ALPHACHANNEL_REMOVE constant is undefined. How can i solve…
Adil
  • 152
  • 2
  • 8
6
votes
2 answers

Imagemagick text with transparent background

I want to create an iamge with image magick that creates me a text with a transparent background. So far I used this code but it creates me a black background. convert -debug annotate -size 720x480 -background none xc:black -fill white -stroke white…
utdev
  • 3,942
  • 8
  • 40
  • 70
6
votes
2 answers

How to convert .pdf file to .png using Imagemagick PHP API

I want to convert .pdf file to .png file using Imagemagick php API. we can do this from shell using this: $convert sample.pdf sample_image.png we can issue this command using php exec() function but due to some reason (security) I disabled the…
Peeyush
  • 4,728
  • 16
  • 64
  • 92
6
votes
2 answers

ImageMagick PDF crop retain quality

I have got some PDF files i need to crop (crop to trimbox etc), which I can do with the following command convert -define pdf:use-trimbox=true -density 300 original.pdf outcome.pdf It does the job however the outcome.pdf quality if not as sharp as…
Display name
  • 420
  • 5
  • 20
6
votes
1 answer

What's the practical differences between imagick::INTERLACE_JPEG/INTERLACE_PLANE/INTERLACE_LINE?

There's many "interlace" options in ImageMagick, but I don't really understand the difference. All of the options in the title appear to generate a comparable JPG file - maybe if I had a slower/throttled connection I could discern a difference. Is…
Codemonkey
  • 4,455
  • 5
  • 44
  • 76