6

Im wondering how to generate color schemes from an image in iOS. I surfed and found some related links where I can get average color from an image from here and also could get the exact color values from the point touched from an image from here and here But I couldn't get how I can get color schemes(altleast 10 colors) from that image.

First, I divided the given image into nine parts and processed each to get the dominant color of that particular part. It worked, but as the code in the link gets only the average color, which seems to be muddy.

So, I want it to be true colors from the image. This is my need. Can someone point me how to get the exact color schemes from the given image?

Community
  • 1
  • 1
Ananth
  • 815
  • 9
  • 26

3 Answers3

7

I have created a iOS project in github to implement a class that can return a color scheme in function of an input image. Currently is a very slow process, but I have been working on it, (branch developGPUQuantization) and making a lot of progress (like 100 times faster). I hope to merge this branch into master soon.

Also, you can check this question to get more information.

Community
  • 1
  • 1
LuisEspinoza
  • 8,508
  • 6
  • 35
  • 57
4

To get colors from a image you could use DBImageColorPicker. This component allows getting various kinds of main colors also additional primary text color and secondary text color.

d0ping
  • 462
  • 4
  • 16
2

There's some code on GitHub that mirrors the behaviour of the new iTunes https://github.com/panicinc/ColorArt which sounds a lot like what you're trying to do. It gets background / primary / secondary / detail colours, rather than the 10 you're after, but it'd probably be a good place to start.

Jonathan Caryl
  • 1,330
  • 3
  • 12
  • 30
  • Thanks @Jonathan, that was really the one Im asking for, but would be better if its for iOS, coz there is no class named `NSGradient` in iOS, that I couldn't get into. – Ananth Mar 09 '13 at 09:41
  • There's some more code on GitHub that has an NSGradient-like class for iOS: https://github.com/larcus94/LBGradient – Jonathan Caryl Mar 14 '13 at 07:37