z

z / ColorPalettefromImage / 0.1.0

README.md

Introduction

Uses https://github.com/fengsp/color-thief-py to extract color palette from a given image. A Json input with the url and the number of colors that are to be extracted is necessary to run this algorithm.

Input:

  • (Required): Image URL. (key="url")
  • (Required): Number of colors (key="count")

Output:

  • A list with color palettes with the [R, G, B] format.

Example(s)

Example 1.

  • Parameter 1: Sample Image
  • Parameter 2: 4 Palettes
{
  "url": "https://s3.amazonaws.com/algorithmia-assets/algo_desc_images/z_ColorPalettefromImage/leonarda_da_vinci.jpg",
  "count": 4
}

Output:

[
  [209, 176, 145],
  [171, 109, 64],
  [240, 242, 241],
  [145, 107, 84]
]

Example 2.

  • Parameter 1: Sample Image
  • Parameter 2: 8 Palettes
{
  "url": "https://s3.amazonaws.com/algorithmia-assets/algo_desc_images/z_ColorPalettefromImage/leonarda_da_vinci.jpg",
  "count": 7
}

Output:

[
  [212, 183, 155],
  [171, 109, 64],
  [240, 242, 241],
  [195, 140, 97],
  [235, 220, 196],
  [145, 124, 101],
  [145, 107, 84]
]