Page 1 of 1

How to batch composite same image as bg to all images

Posted: 2011-05-27T03:15:11-07:00
by toxicv
Hi
I thought this would be a fairly straighforward command but cannot figure out how to do it.

I have a directory full of transparent PNG files which I would like to replace the transparent background with the SAME image to ALL.

The background image I would like to use is called bg.jpg and the images I would like to add this to the background to are all randomly named *.PNG files.

The background JPEG is 800x677 pixels and the PNG files need to be resized to fit that resolution too. Ideally at the same command but obviously if I need to run two batches, one to resize the PNGs first, then one to do the composition then that's fine. But would prefer to do the whole resize and composition in one run if possible.

Is there a simple mogrify option to batch run a whole folder?

Thanks!

Re: How to batch composite same image as bg to all images

Posted: 2011-05-27T09:36:58-07:00
by fmw42
mogrify only works with one image at a time. you cannot do composition with mogrify, to my knowledge. looks like you need to write a script to loop over all your images and do the composition and other things. But also see http://www.imagemagick.org/Usage/basics/#mogrify_not