0

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,

AP.
  • 5,205
  • 7
  • 50
  • 94

1 Answers1

0

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'.

Community
  • 1
  • 1
Stefan Arentz
  • 34,311
  • 8
  • 67
  • 88
  • I still don't see how to modify there data... perhaps I'm missing it but the second question does not have an answer. – Marius Feb 11 '11 at 23:04