
And after processing the image we get the circle in one file and the triangle in another. Like cropping but instead of specifying the tile size, the shapes get autodetected and extracted into separate files.
I'm aware something similar can be done with a script I found here, but the images I need to do this on have more than two colors.