Hi Everyone,
I am having an issue while converting a PDF to a thumbnail PNG image, either the text doesn't display or is garbled up... Hope someone can help I can't determine any other possible ways to fix the issue.
Here is what the PDF looks like:
This is the result of the conversion:
Command I am using is:
convert -colorspace RGB Abcs.pdf[0] -colorspace sRGB -resize '25%' -quality 100 test.png
Software Versions I am using
ImageMagick 6.9.7-4 Q16 x86_64 20170114
GPL Ghostscript 9.22 (2017-10-04)
Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-32-generic x86_64)
Converting PDF to PNG Issue
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting PDF to PNG Issue
Please post the actual pdf to some free hosting service that won't change it or zip it first before posting. Then put the URL to the PDF or zip file here.
You seem to convert to linear RGB when reading the PDF rather than nonlinear sRGB. Then you change it to non-linear. That could be an issue.
Try just reading it in as sRGB.
You seem to convert to linear RGB when reading the PDF rather than nonlinear sRGB. Then you change it to non-linear. That could be an issue.
Try just reading it in as sRGB.
Code: Select all
convert -colorspace sRGB Abcs.pdf[0] -resize '25%' -quality 100 test.png
Re: Converting PDF to PNG Issue
thanks for the quick response i did try your suggested command but got the same results. here is the full pdf file.fmw42 wrote: ↑2018-08-23T18:37:32-07:00 Please post the actual pdf to some free hosting service that won't change it or zip it first before posting. Then put the URL to the PDF or zip file here.
You seem to convert to linear RGB when reading the PDF rather than nonlinear sRGB. Then you change it to non-linear. That could be an issue.
Try just reading it in as sRGB.
Code: Select all
convert -colorspace sRGB Abcs.pdf[0] -resize '25%' -quality 100 test.png
Last edited by sgreene on 2018-08-26T06:31:24-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting PDF to PNG Issue
This works fine for me using ImageMagick 6.9.10.10 Q16 Mac OSX with ghostscript 9.21 and libpng 1.6.34
If this does not work, then upgrade ghostscript (as I have heard there were issues with 9.22) and also upgrade libpng, if needed.
Code: Select all
convert -colorspace sRGB -density 288 abcsousr.pdf[0] -resize 25% result.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Converting PDF to PNG Issue
It also works fine for me, IM 7.0.7-28 and Ghostscript v9.19.
snibgo's IM pages: im.snibgo.com
Re: Converting PDF to PNG Issue
Thank you everyone, I have manually upgraded to 9.23 (what a pain) and it's working great now. I was using apt-get to install and it only has 9.22 as latest version.