Page 1 of 1

Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T10:36:09-07:00
by mr_hunter
Hello all,

I originally responded to an old thread for this issue but here it is in a new thread with more detail.

I'm trying to append an image on-top of each page within a multi-page tiff or PDF, but it seems to be placing each page of the tiff/pdf on top of each other so the result is a one page tiff/pdf. It works fine for a single paged tiff fine.

Multi-Paged Tiff
Code:
convert SmallMultiplePages.tif stampOnDoc.gif -gravity northwest -geometry +3+3 -define compose:args=80,100 -compose dissolve ^
-composite -depth 8 -compress zip StampMultiplePages.pdf

MultiplePages.tif https://www.dropbox.com/s/ng99t8g82n9s0 ... s.tif?dl=0
stampOnDoc.gif https://www.dropbox.com/s/60y2w91o6vef2 ... c.gif?dl=0
StampMultiplePages.tif https://www.dropbox.com/s/wceuf2t6smhnh ... s.pdf?dl=0

Single Paged Tiff - Works OK
Code:
convert OnePage.tif stampOnDoc.gif -gravity northwest -geometry +3+3 -define compose:args=80,100 -compose dissolve ^
-composite -depth 8 -compress zip StampOnePage.tif

OnePage.tif https://www.dropbox.com/s/w1jv5d8gnqtuj ... e.tif?dl=0
stampOnDoc.gif https://www.dropbox.com/s/8kbd9h0dzg7bp ... c.gif?dl=0
StampOnePage.tif https://www.dropbox.com/s/zcj17igb1gphs ... e.tif?dl=0

Any assistance appreciated :)

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T11:09:17-07:00
by snibgo
You want to composite the gif with the first image, then with the second, and so on, making (n) outputs? "-layers composite" with a null: does this. See http://imagemagick.org/script/command-l ... php#layers

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T11:36:30-07:00
by mr_hunter
Sorry pretty new to this. Any suggestions what I should change the code to?

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T13:17:02-07:00
by snibgo
Something like this:

Code: Select all

convert SmallMultiplePages.tif null: stampOnDoc.gif -gravity northwest -geometry +3+3 -define compose:args=80,100 -compose dissolve -layers composite -depth 8 -compress zip StampMultiplePages.pdf
It creates a multi-page PDF, with the stamp in the top-left corner of each page.

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T13:27:42-07:00
by fmw42
See my similar answer at viewtopic.php?f=3&t=28820&p=128243#p128241. I was not sure that -layers composite respected the compose setting, so I used the alpha channel in the gif setting it to 80%

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T13:43:42-07:00
by snibgo
"-layers composite" does respect the settings. For example, if we change the args to ...

Code: Select all

-define compose:args=20,100
... the stamp becomes very faint.

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T14:06:52-07:00
by fmw42
Yes, I now know it works from your command line. I just never tested it and went with the alternate solution. Thanks for the clarification.

As is often the case, there can be different approaches to get the same result, especially when dealing with blending

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T14:56:55-07:00
by snibgo
As always, there are multiple options when depriving a feline of its epidermis. There may be performance differences between the methods.

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-10T15:34:32-07:00
by fmw42
snibgo wrote:depriving a feline of its epidermis.
Cute!

Re: Possible Issue with Converting a Multi-Page Tiff?

Posted: 2016-01-11T03:36:18-07:00
by mr_hunter
Thanks that has worked a treat! Much appreciated!!