Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating Color schemes from an image

Tags:

ios

image

uicolor

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?

like image 800
Ananth Avatar asked Jul 10 '12 08:07

Ananth


People also ask

How do you get a Colour palette from a photo?

The easiest place to get colors from your photos Want a color scheme that perfectly matches your favorite images? With Canva's color palette generator, you can create color combinations in seconds. Simply upload a photo, and we'll use the hues in the photo to create your palette.

How do you extract a color from an Image and save it to the color swatches?

Choose Image > Mode > Color Table to view it and the colors selected from your image. 5. Now you can save the table, otherwise you'll lose the new palette you've created. Hit the Save button on the Color Table dialog box and then save it into Photoshop > Presets > Color Swatches folder.


2 Answers

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.

like image 22
d0ping Avatar answered Sep 18 '22 02:09

d0ping


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.

like image 94
LuisEspinoza Avatar answered Sep 18 '22 02:09

LuisEspinoza