Problem Converting from PDF to TIF

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
kyle h.

Problem Converting from PDF to TIF

Post by kyle h. »

Background:

We have 2 environments.

Both are Win2003 Server boxes w/ SP2, both use ImageMagick 6.2.6 Q8.

Both use this command: convert -density 200x200 -dither -compress group4 E:\file.pdf -monochrome E:\file.tif

1 environment this works and has been working fine for several years. More recently we started using the other environment, and we are not getting the same results.


The Problem:

The files that are being converted are forms with typed text on them. We see the problem with words typed in all uppercase. Certain letters are slightly larger than the rest of the font.

I've been working with ImageMagick for about 2 days now. I started by installing the new 6.4.6 Q8 version, which fixes the problem, but you need to adjust the dither option (which I'm not sure is even necessary? redundant with the use of -monochrome?)

So going back to using version 6.2.6 Q8, I started adjusting the options used and it seems like the problem is in the -density 200x200.

I was about to start using the debug option but I'm not sure which debug event to use. Any thoughts?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem Converting from PDF to TIF

Post by anthony »

-dither was generally not used as it was the default.

In a recent change it now takes an argument (type of dither) which would make the above fail.

Leave it off to avoid problems.

-monochrome does not understand or respect +/-dither setting. A -monochrome without dithering is after all just a -threshold.

See IM examples, Quantization and Dithering for more info.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
kyle h.

Re: Problem Converting from PDF to TIF

Post by kyle h. »

Ok, so I adjusted my command line options to this: convert -density 200x200 -compress group4 D:\file.pdf -threshold 50 D:\file.tif

I still have the font issues, that I think is caused by the -density 200x200 option.

Is there a library that the -density option uses that might be corrupt?
kyle h.

Re: Problem Converting from PDF to TIF

Post by kyle h. »

Ok back with more info.

I've adjusted the -density up and down and that seems to fix it, something about the ~200x200 area that causes the fonts to get tweaked.

I went up to 300x300, which fixes it, but quickly realized the file size was going to be too large for our application.

So I took it down to 150x150, looks fine.

Brought it up in increments to 190x190 where it distorts. So at 185x185 it looks fine.

But the question still remains, why does this work on one machine and not the other?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem Converting from PDF to TIF

Post by fmw42 »

Do you have the exact same font file (not just font name)?

Do you have the exact same versions of ghostscript and possibly freetype installed on both machines?

Do you have multiple copies of IM or ghostscript or freetype installed and if so do you know which one you are actually using?

Just some things to check.
kyle h.

Re: Problem Converting from PDF to TIF

Post by kyle h. »

Problem solved.


There was a different version of ghost script on the problematic system, ghost script 8.54.

Thanks for your help!
Post Reply