Hello !
( sorry i'am french )
how superimposed two photograph in Linux OS? ( using just bash terminal )
example :
photo in
the pix for paste ( 75% of opacity for the paste )
and the final
how to do that ?
Thanx
superposition of image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: superposition of image
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/
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
ok
this command of my utilitie
$ composite -dissolve 25 -gravity south tampon.png in.jpg out.jpg
thanx !
this command of my utilitie
$ composite -dissolve 25 -gravity south tampon.png in.jpg out.jpg
thanx !