S
S
Sergey Sova2014-04-25 09:14:21
PHP
Sergey Sova, 2014-04-25 09:14:21

How to determine the main color of the picture?

So, I'm doing a photo stock for a client.
He demanded a color search.
I thought to do this: when loading a picture, several color tags are
displayed. Well, for example, there are #red, #green, #violet... etc.
I have a list of such colors in #hex, there are 68 of them.
When loading a picture, you need to determine which 3-4 colors are present in the picture.
It is also important that the algorithm understands hues.
Well, for example, a picture: a girl on a black background, so that the basic colors are determined - black and orange.
If there are better suggestions, I'll listen carefully.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
v_prom, 2014-04-25
@v_prom

usually the picture is compressed into low resolution and the colors of the pixels are determined, tags can be automatically filled in from them. but it will be very difficult to understand the shades.

K
Konstantin Velichko, 2014-04-25
@Zoxon

habrahabr.ru/post/136530
habrahabr.ru/post/137868

E
Ellinium, 2014-04-25
@Ellinium

Convert color model from RGB to HSL/HSV. And there already operate with one parameter H.

C
Colors Wall, 2018-08-29
@colorswall

  1. How to take a color palette from an image
  2. First color from the left

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question