split one huge tiff file (650 images) into smaller tif files (of like 100)

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
samster712
Posts: 2
Joined: 2015-11-13T14:15:21-07:00
Authentication code: 1151

split one huge tiff file (650 images) into smaller tif files (of like 100)

Post by samster712 »

HI,
I was wondering if there was a function in imageMagick for me to take a huge multipage tiff file with 600+ images (about 2GB) and split it into two or more smaller tifs files. Like for instance If i want to separate the first 100 images into a new tiff files so that i can analyze those first 100 separately.
thanks
Sam
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: split one huge tiff file (650 images) into smaller tif files (of like 100)

Post by fmw42 »

Code: Select all

convert image.tif[0-99] newimage.tif
But you will need lots of RAM to do it efficiently, since you need to load the whole input tiff.

see
http://www.imagemagick.org/Usage/basics/#list_ops
http://www.imagemagick.org/script/comma ... essing.php (selecting frames)
samster712
Posts: 2
Joined: 2015-11-13T14:15:21-07:00
Authentication code: 1151

Re: split one huge tiff file (650 images) into smaller tif files (of like 100)

Post by samster712 »

i have 16GB is that enough?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: split one huge tiff file (650 images) into smaller tif files (of like 100)

Post by fmw42 »

If your file is 2GB, you should have enough. You need enough to hold the input and output images.

If you want to separate the input into several output files, you can do that all at one time.

In unix syntax,

Code: Select all

convert input.tif \
\( -clone 0-99 -write output0.tif +delete \) \
\( -clone 100-199 -write output1.tif +delete \) \
...etc...
\( -clone 600--1 -write output6.tiff +delete \) \
null:

in Windows syntax:

Code: Select all

convert input.tif ^
( -clone 0-99 -write output0.tif +delete ) ^
( -clone 100-199 -write output1.tif +delete ) ^
...etc...
( -clone 600--1 -write output6.tiff +delete ) ^
null:

Always best to provide you IM version and platform, when asking questions on this forum
Post Reply