Hi, I am using ImageMagick to rasterize PDFs to PPM.  The catch is that the 
PDFs are absolutely huge.  The one file I have completed is 61.05 inches by 
21.05 inches, and the lowest readable resolution is 125 dpi.  It took 67 
minutes to do this conversion on my 2.8GHz P4 computer.  (After taking a
second look, I found that some of the smallest text isn't readable below 150 
dpi.)

However, when I looked at the PPM output, I saw that it is only readable at 150 
dpi when antialiased, such as in the display given by acroread.  While 
unantialiased 200 dpi just might be readable, I won't have enough texture 
memory to display the result.  In this case, antialiasing is a form of 
compression.

I presume acroread performs antialiasing using supersampling, although 
theoretically it could integrate the vector shapes over the pixel area.  I 
doubt it goes to such lengths. :^)  It looks like it uses 4x4 supersampling, 
since I see 16 unique colors in acroread's rasterized output (taken from a 
screenshot) for an area consisting of monochromatic lines against the 
page-white background.

How can I perform similar antialiasing using ImageMagick?  If I rasterize at 
150 * 4 = 600 dpi, each page will take at least 25 hours 44 minutes and 1.3 
gigabytes RAM, plus whatever time and memory are required for downsampling to 
150 dpi.  Multiply that by 51, the number of PDFs I have, and it will take 
nearly two months to complete the work!  But, the source PDFs are updated every 
month and a half!  I should add that rasterization is only the first stage in 
the processing pipeline these images must go through.

Surely better algorithms exist!  For instance, it should be possible to divide 
the image into manageable chunks, which can be processed in parallel on 
multiple CPUs, cores, and/or computers.

Here's the command I used:

$ convert -density 125 ENR_L17.pdf ENR_L17.ppm

And here's the subordinate GhostScript invocation:

$ gs -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE \
-dAlignToPixels=0 -sDEVICE=pnmraw -dTextAlphaBits=4 \
-dGraphicsAlphaBits=4 -g4429x8290 -r125x125 \
-sOutputFile=/tmp/magick-XXska6QX -f/tmp/magick-XXujWXK4 \
-fENR_L17.pdf

So... any ideas?

I'm aware that this is as much a GhostScript question as it is an ImageMagick 
question, but there must be people subscribed to this list who have experience 
with both.

-- 
Andy Goth | http://andy.junkdrome.org./
ununun...@{aircanopy.net,openverse.com}
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to