Page 1 of 1

Mask using -composite

Posted: 2010-11-19T15:15:21-07:00
by sshadows
Hi everyone !
I would like to use the masks ( like those : http://www.imagemagick.org/Usage/compose/#dstin ) with that method of composing : http://www.imagemagick.org/Usage/layers/#convert

Here is what I've tried :

Code: Select all

  convert -size 100x100 xc:skyblue \
          balloon.gif  -geometry  +5+10  -composite \
          medical.gif  -geometry +35+30  -composite \
          present.gif  -geometry +62+50  -composite \

       -compose Dst_In  -gravity center \
         present.png  rose: -alpha Set  medical.gif -composite \ 

          shading.gif  -geometry +10+55  -composite \
          compose.gif
I'm not looking for the exact results but just the way to use mask in this method of layering.
Thank you in advance !
Good Bye

Re: Mask using -composite

Posted: 2010-11-19T16:10:52-07:00
by fmw42
I am not sure I follow your command, but the mask image must the 3rd of only 3 image, the first the background and the second is the overlay image.

see http://www.imagemagick.org/Usage/compose/#compose

Possibly parenthesis processing with -clone and -delete will help your command.

see http://www.imagemagick.org/Usage/basics/#image_seq

Re: Mask using -composite

Posted: 2010-11-20T03:03:04-07:00
by sshadows
Hi, and thanks for your answer !

Possibly parenthesis processing with -clone and -delete will help your command.
I'm not sure I really understand, could you please give me an example ?


I've tried another method but it's not working neither :

Code: Select all

             present.gif medical.gif -compose DstIn -composite \
Any idea ?

Thanks again for your help !

Re: Mask using -composite

Posted: 2010-11-20T11:35:42-07:00
by fmw42
I believe your problem may be in this part of your command


-compose Dst_In -gravity center \
present.png rose: -alpha Set medical.gif -composite \


to me it looks like you are trying to merge more than 3 images: result from previous composite, present.png rose: and medical.gif.

As I said before, composite only allows you to use 3 images and the last will be the mask.

On suggestion is to use -write tmp1.png after each major part of your command (changing the number each time), so that you can review the steps you are using to see that you get the expected and correct results at each step


Further explanation of what you are trying to do might also be helpful and or an example from somewhere else.