Page 1 of 1
Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-12T06:35:08-07:00
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.
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-12T06:36:40-07:00
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.
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-12T09:33:27-07:00
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
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-14T07:13:29-07:00
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
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-14T10:10:45-07:00
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.
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-14T16:27:37-07:00
by MNukazawa
Code: Select all
convert -list format | grep JPEG | ~
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (80)
GPL Ghostscript 9.22 (2017-10-04)
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-14T16:43:06-07:00
by fmw42
My libjpeg is 90. My GS is 9.21. Perhaps upgrade your libjpeg and see if that helps.
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-15T09:42:47-07:00
by MNukazawa
Upgrading libjpeg in Ubuntu seems not easy.
I will search for the procedure.
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-15T11:50:54-07:00
by fmw42
Can you upgrade your Imagemagick? What is your platform/OS?
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-18T00:56:17-07:00
by neilcannon
I had the same problem - upgrading ghostscript from 9.22 to 9.23 fixed it for me on macOS
Re: Convert PDF with font to JPG, annoying horizontal line
Posted: 2018-04-18T05:03:27-07:00
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.