2

I want to find out all the pixels fit the specified color in bitmap.

For example, I want to find the positions(x, y) of the pixels these are color: [UIColor colorWithRed:255 green:0 blue:0 alpha:1].

How to get this?

Suge
  • 2,808
  • 3
  • 48
  • 79

1 Answers1

0

This should get you started:

How to get pixel data from a UIImage (Cocoa Touch) or CGImage (Core Graphics)?

Community
  • 1
  • 1
Danilo
  • 3,257
  • 2
  • 19
  • 24
  • `UIImagePNGRepresentation()` returns, as the name says, PNG data, which is a **compressed** representation of the image. Accessing the pixels like in your code will not work. – Martin R Jun 28 '13 at 06:02
  • Thank you, but I want to find the pixel position with color, not find color of the pixel from image. – Suge Jun 28 '13 at 07:01