user1861458
user1861458

Reputation:

Check overall UIColor?

Is there a simple way to check the overall color of a UIImage?

//For example
if ([someImage isMostly:[[UIColor whiteColor] CGColor]] {
    NSLog(@"This image is mostly white!");
}

I would imagine it's not that simple though. One approach could be possibly to pick a few random coordinates and average the colors together. Am I on the right track?

Upvotes: 2

Views: 112

Answers (1)

zoul
zoul

Reputation: 104145

One approach is to create the image histogram and then simply pick the most frequent color.

Upvotes: 2

Related Questions