THC
THC

Reputation: 232

Get human-readable colors from image

I want to convert a bitmap with colored squares to an array of Strings being the names of the colors in the squares. I am facing some issues :

  1. Color may vary, as it comes from a phone camera and therefore it may not be the same on all phone and context (light, camera saturation)
  2. Squares are not exactly of one color. See example below.

Example :

Original picture

And I need to return something like this :

{"blue", "green", "white", "yellow", "orange", "blue", "green", "orange"}

Upvotes: 0

Views: 148

Answers (1)

atabouraya
atabouraya

Reputation: 3332

I suggest you use Palette Helper Class, it helps extract colors from a bitmap, however the number is limited.

Here's a nice article on how to use it. Extracting Colors to a Palette with Android Lollipop

Upvotes: 1

Related Questions