Copy randomized rectangles from one directory of images to another
Posted: 2019-08-16T11:24:38-07:00
Hello. I'm pretty new to ImageMagick, so some of this may be basic or just not possible. If anyone can help with any part of this process or point me in the right direction, it would be helpful for me and I can continue researching if I don't get the whole solution here.
Basically, I want to take two folders of images, let's call them dataset A, and datasetB. All the images are named to correspond to eachother, so if there's a file called img100.png in dataset A, there's another in the folder datasetB with the same name that corresponds to it. I want to create a new folder with images of the same names that consist of the image from datasetA with random rectangles copied from the image in datasetB over the image in datasetA, like this:
To be clear, this is just an example. The images I'm actually using are not black and white vs color, so I can't use a technique that just applies grayscale to portions of datasetB.
Basically, I want to take two folders of images, let's call them dataset A, and datasetB. All the images are named to correspond to eachother, so if there's a file called img100.png in dataset A, there's another in the folder datasetB with the same name that corresponds to it. I want to create a new folder with images of the same names that consist of the image from datasetA with random rectangles copied from the image in datasetB over the image in datasetA, like this:
To be clear, this is just an example. The images I'm actually using are not black and white vs color, so I can't use a technique that just applies grayscale to portions of datasetB.