Best framework for transformations of raw image data

Hello

I want to programmatically generate a random patterned image, think wallpaper. The method of generation is yet to be established and is unimportant for this question. The output will either be a UIImage or a CIImage object.

Then I want to take a random area of that pattern, a crop effectively, and make one of any number of alterations to it. A non-exhaustive list might include: rotation, swapping colours, other colour effects, shift or scroll.

The area affected might also be one of any number of shapes. A non-exhaustive list might include: square, rectangle, triangle, circle, oval.

Essentially, I want to take a uniform pattern and break or disrupt it in random ways.

So I've been Googling how I might do this and everything seems to point to the Core Image framework, particularly the filters. Although it seems less clear to me how to do transformations, crops and composite images.

My question simply is, am I on the right path pursuing Core Image or are there other ways to achieve these effects?

Thanks Jim

Replies

Hello Jim,

You are on the right path :)

Although it seems less clear to me how to do transformations, crops and composite images.

CIImage has instance methods for each of these common operations:

transformed(by:)

cropped(to:)

composited(over:)