This script searches for any folder in its location called "layer n", where n can be any positive integer, and will make all the combinations between images of each folder (only 1 image per folder) and save the results in a folder called "results", if the folder doesn't exist it will create it.
Right now, it works well with images of the same size and .png format, I haven't tested others.
Each image in the result folder will have the combined name of each part to make it easy to know of what parts are made.