I am converting PDF-s to PNG-s in PHP 7.2, whith Ghostscript 9.18 and it works as expected, but bigger PNG-s (100MB+) easily take over 10 minutes to convert and I would like to bring this 10 minutes down to a few seconds.
What I thought I could do here?
I am running Imagick like this
$this->imagick = new Imagick($pdfFile);
But it will result in a 5-10 minute load time. When looking at htop, most of the time, the "gs" command is running, parsing the PDF. I looked up a few ghostscript options from this thread Any tips for speeding up GhostScript? and I would like to test them with Imagick.
%-> comments to the right
-dNumRenderingThreads=8 % increasing up to 64 didn't make much difference
-dBandHeight=100 % didn't matter much
-dBandBufferSpace=500000000 % (500MB)
-sBandListStorage=memory % may or may not need to be set when gs is compiled
-dBufferSpace=1000000000 % (1GB)
But I can't figure out, how to pass Ghostscript options to Imagick, which would them delegate these to Ghostscript, when running it.
Does anybody have any ideas on how to solve this issue?