I need to manipulate an image such that a sub-rectangle of it is flipped or rotated relative to the rest of the image. Here’s an example:

This manipulation needs to happen many times, each time producing a new modified image from the original (rather than applying successive modifications to one image).
The size of the sub-rectangle needs to vary systematically (perhaps in 5% increments from 10% to 75%) and the location of the sub-rectangle needs to vary randomly.
Lastly, this procedure needs to be carried out on a large number of images.
How would I go about this?
My options are PHP, C#, or batching in Gimp. That said, I’m prepared to learn something new if there’s a particularly sensible approach.
Id say go with C# and write yourself a little utility.
The
Graphicsclass may have all of the methods that you need.Id suggest that you look at the
DrawImageand theRotateTransformfunctions.