Page 1 of 1

NEWBIE: ImageMagick on vServer - too slow - How to install Single core Version?

Posted: 2016-08-15T10:43:49-07:00
by bodomalo
Hello

I am new to the Ubuntu and Linux world, so it is extreme hard for me to come along with all those commands. But I need help.

I use ImageMagick via PHP scripts.

$image = new->Imagick();

Saving an jpg from PDF file takes 30-60 seconds on my Virtual Server. Crazy.

phpinfo() shows me I am using imagick module version 3.1.2, ImageMagick 6.7.7-10
Path to convert is usr/bin/

Can you tell me - step-by-step
a) HOW do I Install a imagick version that uses single-cores?
b) How do I tell PHP to use this NEW version, and not the older 3.1.2 module? (thats my biggest problem)
I think I already installed ImageMAgick 7.0.2.6 in usr/bin/ImageMagick-7... but I can not use it. It also changed from "convert" to "magick.sh" (I think??). So how do I tell php to use this version?

Is there any other solution?

$image = new->Imagick();
$image->setRessourceLimit(6,1); did not help. Has absolute no influence...

Since ever I use ImageMagick it was absolute useless to me. Takes minutes to convert 1 image...

Re: NEWBIE: ImageMagick on vServer - too slow - How to install Single core Version?

Posted: 2016-08-15T11:00:28-07:00
by snibgo
You are using a software stack: PHP calling IMagick, which calls ImageMagick. I have no experience of PHP or IMagick and can't help you there.

In turn, ImageMagick calls Ghostscript to rasterize a PDF.
bodomalo wrote:Saving an jpg from PDF file takes 30-60 seconds on my Virtual Server.
Some jobs take a long time. It's worth testing just ImageMagick and Ghostscript:

Code: Select all

convert -density 300 -units PixelsPerInch in.pdf out.jpg
"-density 300 -units PixelsPerInch" is optional. It controls the granularity of the rasterization, so it has a major impact on performance, quality and output filesize.

Another point: does your PDF contain vector data? Some PDF files are simply wrappers for raster images, so the rasterization process is a waste of time, and almost always reduces quality. In such cases, ImageMagick is the wrong tool for the job. "pdfimages" is more suitable.