Quality degradation of a text pdf after pdf>png>pdf

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
fourat
Posts: 1
Joined: 2012-11-07T13:17:23-07:00
Authentication code: 67789

Quality degradation of a text pdf after pdf>png>pdf

Post by fourat »

Hi,

I have a very specific requirement where i must automatically stamp every page of a PDF file (for a faxing application), so here's the process i've made: The output file of the third step shal be "theoretically" the same as the input file in step 1 (plus the stamp on it) but it's not, the file is somehow blurry and it turns to be unreadeable for humans after faxing it since blurred pixels wouldnt pass through fax wires even if you may see no difference between input.pdf and output.pdf, try zooming in and you'll find that text characters are blurred on its edges.

What is the best parameters to play with at input (step 1) or output (step 3) ?

Thanks !
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Quality degradation of a text pdf after pdf>png>pdf

Post by fmw42 »

In command 2, why are you using mogrify to resize one image rather than convert?

In step 3, your syntax is not proper, though it may work fine. Try putting the input png image right after the convert, then the options, then the output. see

http://www.imagemagick.org/Usage/basics/#why


try increasing the density using in converting your pdf to png, the resize smaller. I typically do a supersampling

convert -density 288 image.pdf -resize 25% image.png

where nominal density is 72, so that 4*72=288 and then resize by 25%. However, supersampling will take longer.

But you can increase the density to what ever works best for you and resize to the dimensions or scale factor you need for the png. The larger the density you give it, the better the quality in the png

IM will call GS to do the conversion. It looks like you are doing something similar with use GS directly to create a png, then resizing it down. Thus I can only suggest a larger density and a smaller resize percent.
Post Reply