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
  • 94,814
  • 14
  • 206
  • 368
RexOnRoids
  • 13,902
  • 33
  • 95
  • 134
  • 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,325
  • 3
  • 32
  • 34
  • 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