3

I'm trying to get an RGB value of a pixel from a CGImageRef object. I know that I need to create a context or something but, how do I do this?

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
RexOnRoids
  • 14,002
  • 33
  • 96
  • 136
  • see my answer on [How to detect a RGB on a point][1] [1]: http://stackoverflow.com/questions/9270923/how-to-read-rgb-pixel-data-on-iphone/22379366#22379366 – Mohit Tomar Mar 13 '14 at 13:14

1 Answers1

3

This post shows you how to do it.

Ramin
  • 13,343
  • 3
  • 33
  • 35
  • 1
    I think [this one](http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage) was better -- it does it with a one pixel image instead of rendering the whole image to grab one pixel. – David Koski Apr 03 '12 at 23:03