Page 1 of 1

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

Posted: 2012-11-07T13:48:03-07:00
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 !

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

Posted: 2012-11-07T15:25:52-07:00
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.