Page 1 of 1

superposition of image

Posted: 2008-04-26T16:40:34-07:00
by MOUS
Hello !

( sorry i'am french :lol: )



how superimposed two photograph in Linux OS? ( using just bash terminal )

example :

photo in
Image
Image

the pix for paste ( 75% of opacity for the paste )
Image

and the final
Image
Image



how to do that ?

Thanx :)

Re: superposition of image

Posted: 2008-04-26T18:59:43-07:00
by fmw42
Try this for an example with 50% opacity (where opacity=100 - transparency), which overlays the rose: image onto the logo: image.

convert logo: \
\( rose: -alpha on -channel A -evaluate set 50% \) \
-geometry +50+50 -composite logo_rose.png


In general:
convert backgroundimage \
\( overlayimage -alpha on -channel A -evaluate set OPACITY% \) \
-geometry +XLOCATION+YLOCATION -composite resultimage

The first image is the background, the second image is to be overlaid. The second line turns on the alpha channel and sets its opacity. The third line identifies where to overlay the second image on the first image and does the composite.

If you want to put the overlayimage in two (or more) places, then do as follows:

convert backgroundimage \
\( overlayimage -alpha on -channel A -evaluate set OPACITY% \) \
-geometry +XLOCATION1+YLOCATION1 -composite \
\( overlayimage -alpha on -channel A -evaluate set OPACITY% \) \
-geometry +XLOCATION2+YLOCATION2 -composite \
resultimage


You can also use composite and dissolve with two images at a time. This is a little simpler as you don't have to formally create the alpha channel.

composite -dissolve OPACITY% -geometry +XLOCATION+YLOCATION \
overlayimage backgroundimage -matte resultimage

So if you want to put it in two places, for example, you need two command lines.

composite -dissolve 50% -geometry +50+50 rose: logo: -matte logo_rose.png
composite -dissolve 50% -geometry +150+150 rose: logo_rose.png -matte logo_rose.png

or you can combine them into one command as follows:

composite -dissolve 50% -geometry +50+50 rose: logo: -matte miff:- | \
composite -dissolve 50% -geometry +150+150 rose: - -matte logo_rose.png


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

Re: superposition of image

Posted: 2008-05-17T14:49:29-07:00
by MOUS
ok

this command of my utilitie ;)

$ composite -dissolve 25 -gravity south tampon.png in.jpg out.jpg


thanx ! :)