Page 1 of 1

Concating 2 little filters in one line

Posted: 2008-01-31T08:34:08-07:00
by olagato
Hi, I'm newbie with ImageMagik (version 6.3.8-q16):

I'm working with "Windows XP Command Line" and 2 images to compose a watermark (foto.jpg and logo.png)
I have 2 separate filters that works fine:

a) composite logo.png -resize 50% foto.jpg -compose Multiply -gravity southeast output.jpg
b) convert foto.jpg -mattecolor Tomato -frame 10x10+5+5 output.jpg

Basically I want to merge the 2 images for a watermark and add a border to the output image:
Filter a) make the watermarked image
Filter b) make bordered image

I'm trying to merge both filters in one command line but I dont know how. I have tried the use of parenthesis and arrays without success.
Any ideas ?

Re: Concating 2 little filters in one line

Posted: 2008-01-31T16:56:03-07:00
by anthony
Next time ask this in 'Users Forum' and read the 'before posting' topic.

Code: Select all

convert  foto.jpg \
        \( logo.png -resize 50% +clone +swap \
            -gravity SouthEast -compose Multiply -composite \
            -write output1.jpg  +delete \) \
        -mattecolor Tomato -frame 10x10+5+5 output2.jpg
Which does the following (line by line)...
  • read first image
  • start a new sequence, read and resize overlay, get copy of the first image, and swap there positions (background image first)
  • set up gravity and composition and compose the to images
  • write out that first result, then delete it before closing the now empty sub-sequence
  • frame the original first image and write that as the final (second) result.
See IM Examples, Basics (parenthesis, delete, swap), and File Handling (writing). for more details.

Re: Concating 2 little filters in one line

Posted: 2008-01-31T22:57:48-07:00
by fmw42
This seemed to work for me, if I understand what you are trying:

convert lena.png \( logo: -resize 100x100! \) -gravity southeast \
-compose multiply -composite -mattecolor Tomato -frame 10x10+5+5 tmp.png

So I would think that the following would work for you:

convert foto.jpg \( logo: -resize 50% \) -gravity southeast \
-compose multiply -composite -mattecolor Tomato -frame 10x10+5+5 output.jpg

Re: Concating 2 little filters in one line

Posted: 2008-02-01T01:22:57-07:00
by olagato
Solved !!!

Thank you very much Anthony and Fmw42:
Anthony's solution generated 2 separated images but I need only 1 image as result.
Fmw42's post works fine copying and pasting next sentence in Windows' command line:

convert foto.jpg ( logo.png -resize 50% ) -gravity southeast -compose Multiply -composite -mattecolor Tomato -frame 10x10+5+5 output.jpg