Questions tagged [gmagick]

Gmagick is a php extension to create, modify and obtain meta information of images using the GraphicsMagick API.

Gmagick provides a wrapper to the GraphicsMagick library. GraphicsMagick works with over 88 major formats including important formats like DPX, GIF, JPEG, JPEG-2000, PNG, PDF, PNM, and TIFF.

Gmagick consists of a main Gmagick class, a GmagickDraw class which is in effect a drawing wand and a GmagickPixel class of which instances represent a single pixel of an image (color, opacity).

40 questions
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
4
votes
1 answer

Gmagick set density before loading PDF

Converting a PDF to an image using Gmagick in PHP renders a very poor quality image. The solution in Imagick was to call setResolution(x,y) before loading the PDF file. This would change the -density option. There is no setResolution(x,y) in…
Chad E.
  • 1,196
  • 9
  • 12
4
votes
1 answer

Gmagick convert SVG to PNG with transparent background

I have a problem converting SVG to PNG. The background is white even tough it should be transparent. Example code: $im = new Gmagick(); $im->readImageBlob(''.$svg); $im->setImageBackgroundColor(new \GmagickPixel('transparent'));…
S8N
  • 147
  • 7
4
votes
1 answer

Why is gmagick::thumbnailimage slower than exec(gm)?

In trying to simply thumbnail an image in PHP I used: $image = new Gmagick('/tmp/large.jpg'); $image->thumbnailImage(0, 100); $image->writeImage('/tmp/small.jpg'); which ran in about 15 seconds. I then tried: exec('gm convert -size 200x100…
Isius
  • 6,712
  • 2
  • 22
  • 31
4
votes
1 answer

Image blob is unreadable when downloaded(php)

I have a program with images stored as blobs in a MySQL database, and it works perfectly except for my download link. It downloads just as it should, and is the right size as well, but the images doesn't show. While uploading this is mainly how the…
vebbi
  • 119
  • 11
3
votes
4 answers

Why doesn't setImageInterlaceScheme() make a jpeg progressive?

I'm using php Gmagick to modify images. The following code works as expected except that the images are not progressive. Why? According to the GraphicsMagick docs it should. For reference, the input image is 666 x 1000. $img = new Gmagick(); …
Isius
  • 6,712
  • 2
  • 22
  • 31
3
votes
1 answer

What is the setCompression() equivalent in GraphicsMagick?

The php.net ImageMagick has setCompression() and setCompressionQuality(). The php.net GraphicsMagick shows no compression methods listed at all. However, this changelog shows that setCompressionQuality() was added in 1.0.8b3 and predefined…
Isius
  • 6,712
  • 2
  • 22
  • 31
2
votes
1 answer

GraphicsMagick PHP extension fails to render Google Fonts in SVG

My Ubuntu 14.04 laptop has GraphicsMagick and the PHP extension (GMagick) installed. When I run the following from the command line, gm convert -font /usr/share/fonts/truetype/google-fonts/RockSalt.ttf svg_file.svg jpeg_file.jpg renders the JPEG…
2
votes
1 answer

Scale image according a maximum file size

I'm using Imagick and like to scale an image to a maximum file size of 2.5MB I had a look to this SOF question: ImageMagick: scale JPEG image with a maximum file-size which is exactly what I want to do but the extent() method from Imagick does not…
maxwell2022
  • 2,818
  • 5
  • 41
  • 60
2
votes
1 answer

PHP GMagick: how to get pixel color?

Is it possible to get color of any picture pixel with PHP Gmagick extension? In IMagick I can get this info from getImagePixelColor method: $color = $img->getImagePixelColor($x, $y)->getColor(); How to get this result via GMagick?
Andy Al
  • 29
  • 5
2
votes
1 answer

Gmagick thumbnail for multi-page PDF

I'm attempting to create a thumbnail of a multi-page PDF document using Gmagick, however I only want the first page of the PDF, not all of them. $thumb = new…
r0tterz
  • 198
  • 1
  • 2
  • 10
2
votes
1 answer

Can't install gmagick on Windows 7 XAMPP

I have XAMPP 1.8.1 with PHP 5.4.7 installed. When I add php_gmagick_ts.dll to my php.ini (I made sure that I need the ts and not the nts version), upon restarting Apache I'm getting these errors: The procedure entry point php_checkuid_ex could not…
misaizdaleka
  • 1,776
  • 3
  • 21
  • 32
2
votes
1 answer

php Gmagick save jpeg quality

I can't find any property during save or work with Gmagick PHP extension. http://php.net/manual/en/book.gmagick.php How can I change JPEG quality in Gmagick?
1
vote
1 answer

Image filesize after resizing with Imagick and Gmagick

While resizing an image, I have noticed that Imagick and Gmagick produce images with different filesize on HDD with the same options: $image = new Imagick("c.jpg"); $image->thumbnailImage(260,195); $image->writeImage("c_imagick.jpg"); outputs an…
1
vote
1 answer

How to extract alpha and other channels from a PNG file with PHP Gmagick?

I am trying to port 2 graphics magick commands to the Gmagick php library (mind: not Imagick). The commands are: gm convert -matte -flatten image.png output.png gm convert -channel Matte -negate image.png output.png Basically I am trying to…
Dan Caragea
  • 1,784
  • 1
  • 19
  • 24
1
2 3