Batch command to overlay 2 PNGs on top of each other

Viewed 253

I am in the process of finalizing the creation of graphics and try to automate the overlaying of two PNGs (which have the same size).

I have 2 folders with fixed directories, for example let's say "C:\Users\User\Desktop\Backrounds" and "C:\Users\User\Desktop\Overlays".

The files in "Overlays" are named as follows: "ID-RandomNumber-Backround.png". The variable "Backround" can be "Blue", "Red" or "Yellow".

The files in the "Backrounds" folder are the future backgrounds - named (you almost guessed it): "Blue.png", "Red.png" and "Yellow.png".

My goal at the moment is to write a script, which automates ALL files from the folder Overlays with the corresponding backgrounds (depending on the file name) from the folder Backrounds to provide - so the PNGs in the right order to put on top of each other. So the file "001-2812-Blue.png" should get the background named"Blue.png", the file "002-2612-Yellow.png" should get the background named "Yellow.png" and so on.

I'm using Windows 10 and have thought of a batch script that does this work via imagemagick and composite. Unfortunately, I am currently somehow completely lost, what a possible script could look like. Probably I'm just standing on the hose.

I would be infinitely grateful if you could give me a hint how a possible script could look like. Thank you! If you have any questions or need more information, just let me know!


To make it a little bit clearer what exactly I have in mind, you can find a little graphic enclosed that shows what I have in mind - maybe it helps a little bit :)

enter image description here

0 Answers
Related