Page 1 of 1

Getting weird horizontal lines converting PDF to JPG

Posted: 2019-01-02T10:57:52-07:00
by bg-wilkesreid
I'm converting this file: https://bureaugravity.com/file/floor.pdf to JPG using the following command:

Code: Select all

convert -density 500 floor.pdf -quality 100 floor.jpg
The output I'm getting looks like this: https://bureaugravity.com/file/floor.jpg. I'm getting all these weird gray horizontal lines being introduced. Does anyone know why that might be happening?

My imagemagick and ghostscript are installed on MacOS using Homebrew: imagemagick: stable 7.0.8-22, ghostscript: stable 9.26

Re: Getting weird horizontal lines converting PDF to JPG

Posted: 2019-01-02T10:58:53-07:00
by bg-wilkesreid
This is the full output of convert -version for me:

Version: ImageMagick 7.0.8-22 Q16 x86_64 2018-12-31 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jp2 jpeg lcms ltdl lzma png tiff webp xml zlib

Re: Getting weird horizontal lines converting PDF to JPG

Posted: 2019-01-02T11:34:21-07:00
by fmw42
Do you have Ghostscript installed? If so what is its version? Also what is the version of libjpeg? If not current, then you should try to upgrade those delegates.

Code: Select all

convert floor.pdf floor.jpg
works fine for me with IM 7.0.8.23 Q16 Mac OSX using GS 9.26 and JPEG 90.

You can find your version of GS using

Code: Select all

gs --version
You can find your version of libjpeg using

Code: Select all

convert -list format
and look at the end of the line for JPG

Re: Getting weird horizontal lines converting PDF to JPG

Posted: 2019-01-02T12:15:34-07:00
by bg-wilkesreid
I am using IM 7.0.8-22 Q16, GS 9.26, and libjpeg 90. Also, I get a perfectly fine result when calling just

Code: Select all

convert floor.pdf floor.jpg
but I get those weird lines if I use

Code: Select all

convert -density 500 floor.pdf floor.jpg
Just calling convert by itself won't work for me because I need the jpg image to be a high resolution.

Re: Getting weird horizontal lines converting PDF to JPG

Posted: 2019-01-02T13:34:26-07:00
by fmw42
This command works fine for me with IM 7.0.8.23 Q16 Mac OSX Sierra and GS 9.26 and libjpeg 90. No lines for me

Code: Select all

convert -density 500 floor.pdf -quality 100 floor.jpg
Make sure you have enough space in /tmp. Also try downgrading GS to 9.23. I have heard reports of issue with 9.26 and 9.25. I do not recall about 9.24, but I had good results for a long time with 9.23.

Re: Getting weird horizontal lines converting PDF to JPG

Posted: 2019-01-02T13:56:17-07:00
by bg-wilkesreid
Wow, you were totally right. Downgrading to GS 9.24 completely fixed the issue. Thank you!

Re: Getting weird horizontal lines converting PDF to JPG

Posted: 2019-01-02T14:01:55-07:00
by fmw42
You might report this issue to the Ghostscript team.