Page 1 of 1

PDF > PNG Conversion Issues

Posted: 2017-11-16T09:30:14-07:00
by landstrykere
I'm attempting to convert multi-page PDFs to PNGs (any individual image types will work), but am consistently getting horizontal white lines after the conversion:

Image

These are reminiscent of display issues on Adobe InDesign PDFs (where PDFs for this use case will be created), though I've never had seen them once a document is printed, etc.

Version:

Code: Select all

Version: ImageMagick 7.0.7-11 Q16 x86_64 2017-11-12 http://www.imagemagick.org
Command:

Code: Select all

convert SourcePDF -colorspace sRGB -background white -alpha remove -quality 90 OutputPNG
The issue seems to persist independent of reordering, including/excluding colorspace, density, quality. Relatively new to IM, so it's very likely that I'm missing something obvious. Thanks in advance!

Folder with input/output files

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T10:11:50-07:00
by fmw42
This command works fine for me on IM 7.0.7.11 Q16 Mac OSX

Code: Select all

magick -colorspace sRGB test_export.pdf -background white -alpha remove out.png
Note that you should put -colorspace sRGB before the (vector) PDF input. Or use profiles after reading the PDF.

Also note that -quality is different form png than for jpg. So your value may or may not be good. See http://www.imagemagick.org/script/comma ... hp#quality

Furthermore, in IM 7, magick replaces convert, otherwise, you get the IM 6 convert

You might check your version of Ghostscript and libpng to be sure you are using a current version. My GS is 9.21. My libpng is 1.6.30

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T10:24:21-07:00
by landstrykere
You're not seeing any white hairlines on your export? Weird..

I tried your command as is (thanks for the note on convert > magick) and am still getting the same result. Ghostscript and libpng look like they're both current (9.22 and 1.6.34).

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T10:44:28-07:00
by fmw42
I ran my command 20 times and none of them had striping like on yours. Did you try my command without the -quality?

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T11:09:34-07:00
by landstrykere
Copied and pasted your exact command and left out the -quality and it's still there. Out of curiosity, I installed everything fresh on a separate machine and got the same result.

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T11:23:34-07:00
by fmw42
I am at a loss unless there is a bug in our newer Ghostscript or PNG version?

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T11:24:43-07:00
by fmw42
What is your platform and what tool are you using to view it?

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T11:28:50-07:00
by fmw42
Here is my result:

Code: Select all

magick -colorspace sRGB test_export.pdf -background white -alpha remove test_export.png
Image

When you view it in your same tool that you view your own result, does it show any stripes?

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T11:39:58-07:00
by landstrykere
I'm on Mac OS X, too. The viewing tool doesn't seem to have any effect (tried Preview, Photoshop) and your result appears without the lines in both viewers.

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T11:58:32-07:00
by fmw42
What version of Mac OSX. I am on Sierra.

How did you install IM and the needed delegates? From ImageMagick, Homebrew, MacPorts?

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T12:59:05-07:00
by landstrykere
Still on El Capitan.

I installed both IM and Ghostscript through Homebrew.

Re: PDF > PNG Conversion Issues

Posted: 2017-11-16T13:09:34-07:00
by fmw42
I do not know what more to suggest other than trying to back down your Ghostscript and PNG to the same versions I have. Or try installing IM 6 in place of IM 7.

By the way, I install all my delegates from MacPorts and then install IM from source. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202. This is of course much more complicated than just using Homebrew.