Convert PDF with font to JPG, annoying horizontal line

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
MNukazawa
Posts: 6
Joined: 2018-04-12T06:21:33-07:00
Authentication code: 1152

Convert PDF with font to JPG, annoying horizontal line

Post by MNukazawa »

I convert PDF with my original font (generated by FontForge) to JPG.
But exported image has annoying horizontal line.

# reploduce
source PDF file:
https://github.com/MichinariNukazawa/Ru ... imited.pdf
command:
convert -alpha Remove -density 100 -quality 90 -colorspace rgb book_of_RuneAMN_Pro_Fonts_limited.pdf book.jpg

# result
Exported font image has annoying horizontal line.
[result img][https://pbs.twimg.com/media/DalfkQRUwAAk1AQ.jpg:large]

# workaround
Use GIMP.
MNukazawa
Posts: 6
Joined: 2018-04-12T06:21:33-07:00
Authentication code: 1152

Re: Convert PDF with font to JPG, annoying horizontal line

Post by MNukazawa »

convert -version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib

Environment is Ubuntu18.04 alpha amd64.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PDF with font to JPG, annoying horizontal line

Post by fmw42 »

I do not see any annoying horizontal lines in your JPEG output. I suggest you check your viewing tool. If you think the file has been changed by your hosting service, then check your versions of ghostscript and libjpeg to see that they are current or upgrade Imagemagick.

This command works fine for me on IM 6.9.9.40 Q16 Mac OSX

Code: Select all

convert -density 100 -colorspace sRGB book_of_RuneAMN_Pro_Fonts_limited.pdf[0] -alpha Remove -quality 90 book.jpg
Using

JPG* JPEG rw- Joint Photographic Experts Group JFIF format (90)

and

gs 9.21
MNukazawa
Posts: 6
Joined: 2018-04-12T06:21:33-07:00
Authentication code: 1152

Re: Convert PDF with font to JPG, annoying horizontal line

Post by MNukazawa »

Thank you for your reply.

I report is rasterize issue of my original font (RuneAMN).
(Font file is no problem.)
Reproduce is please try page 4. (using "RuneAMN Sans" font)

Code: Select all

convert -density 100 -colorspace sRGB book_of_RuneAMN_Pro_Fonts_limited.pdf[4] -alpha Remove -quality 90 book.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PDF with font to JPG, annoying horizontal line

Post by fmw42 »

MNukazawa wrote: 2018-04-14T07:13:29-07:00 Reproduce is please try page 4. (using "RuneAMN Sans" font)

Code: Select all

convert -density 100 -colorspace sRGB book_of_RuneAMN_Pro_Fonts_limited.pdf[4] -alpha Remove -quality 90 book.jpg
This command works fine for me on IM 6.9.9.40 Q16 Mac OSX and also 6.9.7.4 Q16 . Check your versions of ghostscript and libjpeg as I mentioned above.
MNukazawa
Posts: 6
Joined: 2018-04-12T06:21:33-07:00
Authentication code: 1152

Re: Convert PDF with font to JPG, annoying horizontal line

Post by MNukazawa »

Code: Select all

convert -list format | grep JPEG | ~
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (80)

Code: Select all

ghostscript -v
GPL Ghostscript 9.22 (2017-10-04)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PDF with font to JPG, annoying horizontal line

Post by fmw42 »

My libjpeg is 90. My GS is 9.21. Perhaps upgrade your libjpeg and see if that helps.
MNukazawa
Posts: 6
Joined: 2018-04-12T06:21:33-07:00
Authentication code: 1152

Re: Convert PDF with font to JPG, annoying horizontal line

Post by MNukazawa »

Upgrading libjpeg in Ubuntu seems not easy.
I will search for the procedure.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PDF with font to JPG, annoying horizontal line

Post by fmw42 »

Can you upgrade your Imagemagick? What is your platform/OS?
neilcannon
Posts: 1
Joined: 2018-04-18T00:54:26-07:00
Authentication code: 1152

Re: Convert PDF with font to JPG, annoying horizontal line

Post by neilcannon »

I had the same problem - upgrading ghostscript from 9.22 to 9.23 fixed it for me on macOS
MNukazawa
Posts: 6
Joined: 2018-04-12T06:21:33-07:00
Authentication code: 1152

Re: Convert PDF with font to JPG, annoying horizontal line

Post by MNukazawa »

Environment is Ubuntu18.04 alpha amd64.

The Ubuntu package contained version 90 libjpeg package, but ImageMagick did not use it.
I have never experienced ImageMagick compilation.
Post Reply