How to split Multipage-Files?

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
mactoni

How to split Multipage-Files?

Post by mactoni »

Hi,

i have some Multipage-Files and i need every Page as an extra File, e.g. Multipagefile A1 with 100 Pages A1_1(only Page 1), A1_2(only Page2) ....
How can i handle that with IM?

Thanks in Advance,
mactoni
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to split Multipage-Files?

Post by fmw42 »

convert image.gif image_%d.gif
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: How to split Multipage-Files?

Post by el_supremo »

If the output format allows multiple page images (I think GIF is one of them) you need to use +adjoin to force IM to create separate output files for each input page:

Code: Select all

convert image.gif +adjoin image_%d.gif
If, for example, the output file format were JPG, you wouldn't need +adjoin because JPG doesn't support multiple pages in one file. But putting +adjoin in anyway won't hurt.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Post Reply