/color-picker

pick most used colors

Primary LanguagePython

Color Picker

pick most used colors.

The file format does not matter. At least jpg and png are possible.

이미지에서 많이 사용된 색을 골라줍니다.

코드를 작성하는 것보다 라이브러리 다운로드 받는게 더더더더더 힘들었습니다..

Requirements

  • sklearn
  • numpy
  • matplotlib
  • opencv
pip3 install sklearn
pip3 install scipy
pip3 install matplotlib
pip3 install opencv-python

How to use

use with Flask

  1. Set environment
export MPLBACKEND="pdf" or "Agg"
  1. run run.py

  2. using Tool like PostMan

POST /pick/colors/<int:num>
Host: localhost:5000
Content-Type: multipart/form-data
Kye: img
Values: file, your image

I recommend that you only include num up to 5

  1. get colors!
{
    "colors": [
        {
            "rgb": [ 30, 25, 24 ],
            "hex": "#1e1918"
        }
}

use with argparse

python pick_colors_with_argparse.py --image images/your_image.png --clusters 3

Reference