Page 1 of 1

Composite multi page tiff to multi page pdf

Posted: 2009-06-13T15:20:16-07:00
by Pakunn
Hello Guys, im kinda new on IM and i have a issue.

I was working with single page tiff, i was using composite to overlap a colored logo over the tiff image and finally i get a single page pdf with color logo, that was just great, but whit multiple page tiff things changed, i only get a single page pdf instead a multi page pdf.

i was looking at the forum and then i tried the following:
convert ( multiple.tif[0] color_logo.jpg -geometry +400+100 -compose multiply -composite ) multiple.tif -delete 1 multiple.pdf

with this commands i finally get a multiple pdf, but the color logo only appears in the first page of the pdf, what can i do to get all the rest of the pages with the color logo, just like the first page ?

thanks for the help.

Re: Composite multi page tiff to multi page pdf

Posted: 2009-06-13T16:44:14-07:00
by fmw42
I am not an expert on this. But it is similar to a gif animation. So you may need to separate all the frames of the tiff using -coalesce and then use -layers composite to overlay the logo on each of them.

see http://www.imagemagick.org/Usage/anim_m ... ite_single

This works for gif sequences. So hopefully it should work for a tif sequence and then output pdf pages.

# create 3 frame gif image from the IM special image logo:
convert logo: logo: logo: logo3.gif

# composite the IM special image rose: on the 3 frame gif in the center
convert \( logo3.gif -coalesce \) null: rose: -gravity center -compose over -layers composite logo_rose.gif

# separate the frames to see that it works
convert logo_rose.gif logo_rose_%d.gif

Re: Composite multi page tiff to multi page pdf

Posted: 2009-06-13T17:05:10-07:00
by Pakunn
hello fmw42, thanks for your answer.

im trying the following:

convert ( logo3.tif -coalesce ) null: rose: -gravity center -compose over -layers composite logo_rose.gif

and i get: convert: UnrecognizedLayerType `composite'.

im not sure about the backslashes that im missing, if i write the backslashes just like you said i get 2 errors about missing image files.

im doing something wrong ?

thanks again for your help.

Re: Composite multi page tiff to multi page pdf [ solved ]

Posted: 2009-06-13T19:39:52-07:00
by Pakunn
Guys, i finally made it, this is how it works:

convert multiple.tif -draw "image over X,X X,X 'color_logo.jpg'" -compress ZIP multiple_color_logo.pdf

where X --> coordenates

and i got my multiple pdf with color logo on every page, sounds easy but it took me almost all day to learn it... :p

im posting it cause, i want to help every one who need it, just like i was.

thanks to fmw42 for the help.

best regards, keep up the good work !

Re: Composite multi page tiff to multi page pdf

Posted: 2009-06-14T06:56:48-07:00
by anthony
Pakunn wrote:i was looking at the forum and then i tried the following:
convert ( multiple.tif[0] color_logo.jpg -geometry +400+100 -compose multiply -composite ) multiple.tif -delete 1 multiple.pdf

with this commands i finally get a multiple pdf, but the color logo only appears in the first page of the pdf, what can i do to get all the rest of the pages with the color logo, just like the first page ?
Well first the parenthesis in this case are not needed as you have no previous image list that needed saving.

For the actual problem the solution is a special composition that will compose two separate image sequences, knowns as -layers composite. this takes two image lists (separated by a null: character, and composes them one pair of images (one from each sequence) until both images sequences are merges together.

BUT here is the kicker. If one of those lists is a single image. That single image will be composed with the other multiple image list! It does not matter if that single image list is 'background' or the 'overlay' image.

So... to your problem. Read the sequence, add a 'null:' marker image, then the logo image.
And just -layers compose.

Code: Select all

convert multiple.tif null: color_logo.jpg -geometry +400+100 -compose multiply -layers composite  multiple.pdf
And hey presto-change-o, the logo was 'multiplied' against each and every image of the multiple list of images, at the geometry specified.

See IM Examples, Layered Composite
http://www.imagemagick.org/Usage/anim_mods/#composite

If you have a really, old IM all is not lost, as -draw can also composite an image against a whole list of images,

Code: Select all

convert multiple.tif -draw 'image multiply 400,100 0,0 "color_logo.jpg" ' multiple.pdf
Though Fred already helped you with this form.

However this method is limited to a external 'coder' source for the 'overlay' image, and can not do many of the other 'cool' things the -layers composite can also do. On the other hand 'draw' can affine 'warp' the input image as it is drawing it, on the fly :-)

See IM Examples, Draw, Drawing primitives (last item)
http://www.imagemagick.org/Usage/draw/#primitives
and Warping of the Drawing Surface
http://www.imagemagick.org/Usage/draw/#transform
for other draw examples.
For the details on the draw 'image' primative syntax see...
http://www.imagemagick.org/script/magic ... .php#image


ASIDE: At this time changes to 'composite' operations has seen its abilities extended to handling other special argumented forms of compose method, that are normally restricted to the "composite" program, and some API's. For example -compose blend. This means these special composes will shortly also be available in "convert" both in -composite and -layers composite, BUT NOT in -draw (can't specify the arguments).

Examples and techniques are currently being developed, so stay tuned!

Re: Composite multi page tiff to multi page pdf

Posted: 2009-06-14T12:07:08-07:00
by fmw42
and i get: convert: UnrecognizedLayerType `composite'.
Your IM version is probably too old.

Re: Composite multi page tiff to multi page pdf

Posted: 2009-06-14T22:07:08-07:00
by Pakunn
Anthony / Fred, you're right i was using an old version of IM.

But as Anthony said all was not lost, so i used -draw to complete my task and worked perfectly.

Now im working on it to install a new version on my server, then i can use all the examples listed up there.

Of course ill be tuned, as i said im kinda new on IM and i really want to learn all the benefits of using IM on compose and converting image files.


Thanks for all the help, you guys are great.
Best Regards.

Re: Composite multi page tiff to multi page pdf

Posted: 2009-06-14T22:38:23-07:00
by fmw42
recommend you read/study Anthony's great pages at
http://www.imagemagick.org/Usage/

Re: Composite multi page tiff to multi page pdf

Posted: 2013-01-10T00:21:32-07:00
by chandrakant
my input is Report_60B_20121108.txt ( text file ) & logo file " logo.jpeg "
i used following command & created courier-new.pdf with imposed logo

enscript -Br Report_60B_20121108.txt -r -fCourier@7.025/10 -o - | ps2pdf - courierl2.pdf

convert courierl2.pdf -draw "image over 0,0 40,40 'logo.jpeg'" -compress ZIP courier-new.pdf

issue : once courier-new.pdf is created unable to use control + f funtion , please help

Re: Composite multi page tiff to multi page pdf

Posted: 2013-01-22T01:41:20-07:00
by chandrakant
chandrakant wrote:my input is Report_60B_20121108.txt ( text file ) & logo file " logo.jpeg "
i used following command & created courier-new.pdf with imposed logo

enscript -Br Report_60B_20121108.txt -r -fCourier@7.025/10 -o - | ps2pdf - courierl2.pdf

convert courierl2.pdf -draw "image over 0,0 40,40 'logo.jpeg'" -compress ZIP courier-new.pdf

issue : once courier-new.pdf is created unable to use control + f funtion , please help

Re: Composite multi page tiff to multi page pdf

Posted: 2013-01-22T10:35:24-07:00
by snibgo
In PDF viewers, control-f searches for text in the PDF file. But you have converted the text to a raster image, a bitmap. So there is no text to search for. IM is a raster tool.

If you want to retain text, other tools such as OpenOffice would be more useful.