Getting weird horizontal lines converting PDF to JPG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bg-wilkesreid
Posts: 4
Joined: 2019-01-02T10:50:33-07:00
Authentication code: 1152

Getting weird horizontal lines converting PDF to JPG

Post 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
bg-wilkesreid
Posts: 4
Joined: 2019-01-02T10:50:33-07:00
Authentication code: 1152

Re: Getting weird horizontal lines converting PDF to JPG

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Getting weird horizontal lines converting PDF to JPG

Post 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
bg-wilkesreid
Posts: 4
Joined: 2019-01-02T10:50:33-07:00
Authentication code: 1152

Re: Getting weird horizontal lines converting PDF to JPG

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Getting weird horizontal lines converting PDF to JPG

Post 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.
bg-wilkesreid
Posts: 4
Joined: 2019-01-02T10:50:33-07:00
Authentication code: 1152

Re: Getting weird horizontal lines converting PDF to JPG

Post by bg-wilkesreid »

Wow, you were totally right. Downgrading to GS 9.24 completely fixed the issue. Thank you!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Getting weird horizontal lines converting PDF to JPG

Post by fmw42 »

You might report this issue to the Ghostscript team.
Post Reply