views:

240

answers:

1

Hi,

I need for a project to modify UIImage. Here are steps I have to follow - I extract the average color of the image by taking several points in the image and calculating the average R, G and B - The next step is to modify the image in order to have a new average R, G and B for the modified image. This new R, G and B is given, the thing I do not know how to do is: how to modify an UIImage in order to pass from an existing average RGB value to a given RGB value.

I am not sure to be very clear. Do not hesitate to ask me if this is not the case.

Thanks in advance for your help!

Regards,

+1  A: 

You will need to use the lower level Core Graphics API to access the image's pixel data.

There have been a number of questions on that before, like for example these two:

The latter contains a link to a good document from Apple, titled 'Getting the pixel data from a CGImage object'.

St3fan