I have a transparent PNG file (a picture of a cow)
I have a folder that contains images of grass, mountains, rivers and so on.
I want to overlay the cow image onto those background images only by using Linux command line.
I have a transparent PNG file (a picture of a cow)
I have a folder that contains images of grass, mountains, rivers and so on.
I want to overlay the cow image onto those background images only by using Linux command line.
convert
tool from the ImageMagick packageYou can merge
images using ImageMagick Layering
I.e.:
convert -page +0+0 grass.jpg \
-page +256+0 clouds.jpg \
-page +512+0 cow1.png \
-background none -layers merge +repage merged.jpg
convert
several imagesLet's suppose that you have two images:
1. grass.jpg
as first image
2. and cow1.jpg
, cow2.jpg
etc as second image to merge
So, your bash
script is:
for image in cow*.jpg; do
convert -page +0+0 grass.jpg \
-page +100+100 $image \
-background none -layers merge +repage $image-merged.jpg
done