Possible Issue with Converting a Multi-Page Tiff?

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
mr_hunter
Posts: 16
Joined: 2015-12-09T08:45:47-07:00
Authentication code: 1151

Possible Issue with Converting a Multi-Page Tiff?

Post 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 :)
Last edited by mr_hunter on 2016-01-10T11:41:37-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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
snibgo's IM pages: im.snibgo.com
mr_hunter
Posts: 16
Joined: 2015-12-09T08:45:47-07:00
Authentication code: 1151

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

Post by mr_hunter »

Sorry pretty new to this. Any suggestions what I should change the code to?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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%
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

As always, there are multiple options when depriving a feline of its epidermis. There may be performance differences between the methods.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

snibgo wrote:depriving a feline of its epidermis.
Cute!
mr_hunter
Posts: 16
Joined: 2015-12-09T08:45:47-07:00
Authentication code: 1151

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

Post by mr_hunter »

Thanks that has worked a treat! Much appreciated!!
Post Reply