-flatten option use in ImageMagick not clear

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
ankurvas
Posts: 14
Joined: 2017-05-25T23:52:09-07:00
Authentication code: 1151

-flatten option use in ImageMagick not clear

Post by ankurvas »

My program uses ImageMagick to convert a multipage tiff to pdf.

convert.exe "C:\multipage_tiff_example.tif" -flatten "pdf:C:\cache\multipage_tiff_example-636946171.pdf"

Issue

If I use -flatten in the above command for multipage tiff files, it only renders the first page of the tiff to pdf.

And removing -flatten, gives the correct PDF rendition for all the pages.

My doubt

I read about the -flatten option as well. But I am unable to understand why it only gives a single page in the rendition.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -flatten option use in ImageMagick not clear

Post by snibgo »

"-flatten" is equivalent to "-layers flatten". From a list of images, it creates a single image. See http://www.imagemagick.org/script/comma ... php#layers
snibgo's IM pages: im.snibgo.com
Post Reply