Convert multi-page TIFF in pieces to avoid memory problems

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
fommil

Convert multi-page TIFF in pieces to avoid memory problems

Post by fommil »

Dear all,

I have a really big (3GB) multi-page TIFF that I would like to break into smaller pieces. I can successfully accomplish this, for smaller files, using a command such as `convert original.tif output%d.tif`, but I am getting various memory errors (e.g. "malloc: *** mmap(size=1048576) failed (error code=12)", "UnableToAcquireString `Cannot allocate memory' @ string.c/AcquireString/126") when I try it on my big file. Is there any way to do the splitting in pieces, so that the whole file is not mmapped?
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Convert multi-page TIFF in pieces to avoid memory proble

Post by GreenKoopa »

I don't have a specific solution, but see if -limit helps.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert multi-page TIFF in pieces to avoid memory proble

Post by magick »

Add -limit area 0 to your command line. You can also convert one page at a time:
  • convert 'image.tif[0]' image-0.jpg
    convert 'image.tif[1]' image-1.jpg
    ...
Post Reply