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 » 2018-04-12T06:35:08-07:00

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 » 2018-04-12T06:36:40-07:00

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: 23251
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 » 2018-04-12T09:33:27-07:00

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 » 2018-04-14T07:13:29-07:00

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: 23251
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 » 2018-04-14T10:10:45-07:00

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 » 2018-04-14T16:27:37-07:00

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: 23251
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 » 2018-04-14T16:43:06-07:00

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 » 2018-04-15T09:42:47-07:00

Upgrading libjpeg in Ubuntu seems not easy.
I will search for the procedure.

User avatar
fmw42
Posts: 23251
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 » 2018-04-15T11:50:54-07:00

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 » 2018-04-18T00:56:17-07:00

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 » 2018-04-18T05:03:27-07:00

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