Page 1 of 1

-flatten option use in ImageMagick not clear

Posted: 2017-05-25T23:58:56-07:00
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.

Re: -flatten option use in ImageMagick not clear

Posted: 2017-05-26T07:47:53-07:00
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