White Background lost while upgrading imagemagick??
Posted: 2018-03-27T10:54:25-07:00
I'm trying to convert PDFs to PNGs using ImageMagick and Ghostscript.
The image on the left was created used ImageMagick 6.7.5 and Ghostscript 9.05.
The command was
$cmd = '/usr/bin/convert upload/foo.pdf -density 1200x1200 -quality 100 -resize '.$width.'x'.$height.' rename/foo.png ';
My host changed the software on server which now has ImageMagick 6.8.0-1 and Ghostscript 9.06. I ran my script again and page was now transparent instead of white. With a black webpage behind it, the music notes could not be seen.
I changed the command to try to force the background to be white, by adding alpha off as follows
$cmd = '/usr/bin/convert upload/foo.pdf -density 1200x1200 -quality 100 -alpha off -resize '.$width.'x'.$height.' rename/foo.png ';
this made the background white as desired, but the image quality is now degraded (image on the right).
What is the best way to have a white background AND same music quality as before?
The image on the left was created used ImageMagick 6.7.5 and Ghostscript 9.05.
The command was
$cmd = '/usr/bin/convert upload/foo.pdf -density 1200x1200 -quality 100 -resize '.$width.'x'.$height.' rename/foo.png ';
My host changed the software on server which now has ImageMagick 6.8.0-1 and Ghostscript 9.06. I ran my script again and page was now transparent instead of white. With a black webpage behind it, the music notes could not be seen.
I changed the command to try to force the background to be white, by adding alpha off as follows
$cmd = '/usr/bin/convert upload/foo.pdf -density 1200x1200 -quality 100 -alpha off -resize '.$width.'x'.$height.' rename/foo.png ';
this made the background white as desired, but the image quality is now degraded (image on the right).
What is the best way to have a white background AND same music quality as before?