tile crop of pdf seems to rasterize whole image before crop?

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
matteosistisette
Posts: 17
Joined: 2011-10-10T09:04:08-07:00
Authentication code: 8675308

tile crop of pdf seems to rasterize whole image before crop?

Post by matteosistisette »

Hi,

I'm slicing a huge pdf file into a sequence of png images. I use convert with the -crop option, specifying only width and hight (not offsets) so it does the automatic tiling.

I would expect imagemagick to rasterize each tile (portion of the pdf) into a bitmap, process and output it, and then rasterize the next piece, etc. However, I am under the impression that it is actually rasterizing the whole pdf into a huuuuuuge bitmap and then cropping it into pieces, requiring a huge amount of memory that wouldn't be needed otherwise. Is it so?

And if I wanted to crop only _one_ piece of the pdf (i.e., specify also x and y offsets), would it still rasterize the whole pdf and then crop the bitmap?

Thanks
m.
matteosistisette
Posts: 17
Joined: 2011-10-10T09:04:08-07:00
Authentication code: 8675308

Re: tile crop of pdf seems to rasterize whole image before c

Post by matteosistisette »

Well, yes, definitely, that's how it works.
And yes, very sadly, even cropping out a single piece will require processing the whole pdf.

Even repaging to a virtual canvas of the same size of the crop doesn't do the trick.

Is there a way at all to render a small region of a vector image with high density without requiring to render the whole source image? This is definitely possible, because when you view pdf documents in a viewer and you zoom in, the viewer only renders the part that is actually being displayed. If there's no way to do that with ImageMagick, this would cripple any vector-to-bitmap image processing.

Otherwise, does anybody know any other software that would do this? (it must be a command line tool so that I can use it in scripts, because i need to slice the pdf into small images).

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

Re: tile crop of pdf seems to rasterize whole image before c

Post by fmw42 »

Post Reply