Page 1 of 1

Batch overlay multiple images over single source image, convert and save with sequential numbers

Posted: 2017-12-01T04:04:30-07:00
by beedawg1985
I have a folder of .ppm images ( ./overlays )
I have a single .ppm image (./ortho_photo.ppm) that I would like to blend each overlay image over using a photoshop style 'overlay' blend mode
I would like to save the blended images as jpegs with a sequential numbering system (./proc/processed_001.jpg ...002.jpg etc.)

Have tried various methods without much luck:
e.g
convert ./overlays/*.ppm -set filename: '%t' null: ./ortho_photo.ppm -compose overlay ./dest/%[filename:].jpg

Gives me a few images but not looking right and with weird names. Any help would be well appreciated!

Re: Batch overlay multiple images over single source image, convert and save with sequential numbers

Posted: 2017-12-01T04:42:08-07:00
by snibgo
wrote:I have a single .ppm image (./ortho_photo.ppm) that I would like to blend each overlay image over using a photoshop style 'overlay' blend mode.
I'm not exactly sure what you want, but perhaps it is "hardlight", which is the same as "overlay" but swapping the two images.

For the output filename "./proc/processed_001.jpg ...002.jpg", you can simple use "./proc/processed_%03d.jpg" as the output filename.

Re: Batch overlay multiple images over single source image, convert and save with sequential numbers

Posted: 2017-12-01T06:10:41-07:00
by beedawg1985
Hey, yes, hardlight blending of the images would be fine.

I'm now trying:
convert *.ppm /Volumes/Data/RTI/sandbox/ortho/Waun-Mawn16-ortho_modified.comp.ppm -compose hardlight processed_%03d.jpg

Weirdly even though there are only 5 files in the current directory this command produces 10 images, none of which seem to have Waun-Mawn16-ortho_modified.comp.ppm blended into them.

Re: Batch overlay multiple images over single source image, convert and save with sequential numbers

Posted: 2017-12-01T06:19:56-07:00
by snibgo
"-compose" is a setting. It does nothing to images, but effects "-layers composite" (and other operations). So insert "-layers composite" before the output name. See http://www.imagemagick.org/script/comma ... php#layers

You correctly had "null:" after the first list of input images, and you need this for "-layers composite".

Code: Select all

convert *.ppm null: /Volumes/Data/RTI/sandbox/ortho/Waun-Mawn16-ortho_modified.comp.ppm -compose hardlight -layers composite processed_%03d.jpg

Re: Batch overlay multiple images over single source image, convert and save with sequential numbers

Posted: 2017-12-01T06:34:56-07:00
by beedawg1985
That's brilliant - thank you.