GET count_collection_colors

Given an entire image collection or given a subset of the collection filtered using metadata and/or a list of colors and/or a list of collection images, and given a color palette, generate counters for each color from the palette specifying how many of the collection images contain that color.

The response to this request will contain each input palette color along with two counters and a color class. The first counter (num_images_partial_area) gives how many of the collection images contain the palette color (in any percentage). The second counter (num_images_full_area) gives how many of the collection images contain the palette color in a very large percentage (are mostly covered by that color). Each color is associated with one or more of the following main color classes: white, black, grey-light, grey, grey-dark, red-light, red, red-dark, pink-light, pink, pink-dark, orange-light, orange, orange-dark, green-light, green, green-dark, yellow-light, yellow, yellow-dark, blue-light, blue, blue-dark, violet-light, violet, violet-dark, brown-light, brown and brown-dark.

Resource URL

https://multicolorengine.tineye.com/<company>/rest/count_collection_colors/

Parameters

In addition to the Common parameters there are:

Collection

Key

Description

count_colors[0]

A color which you want to count. Can be entered as either RGB format (255,255,255) or hex format (ffffff).

count_colors[n] (optional)

A color which you want to count.

Metadata

Key

Description

metadata

The metadata to be used for image filtering.

count_colors[0]

A color which you want to count. Can be entered as either RGB format (255,255,255) or hex format (ffffff).

count_colors[n] (optional)

A color which you want to count.

Colors

Key

Description

colors[0]

A color to be used for image filtering. Can be entered as either RGB format (255,255,255) or hex format (ffffff).

colors[n] (optional)

A color to be used for image filtering.

weights[0] (optional but required for all colors if specified)

A weight for the first color, should be between 1 and 100 and add up to 100.

weights[n] (optional)

A weight for the nth color.

count_colors[0]

A color which you want to count. Can be entered as either RGB format (255,255,255) or hex format (ffffff).

count_colors[n] (optional)

A color which you want to count.

Filepaths

Key

Description

filepaths[0]

An image file from the collection whose colors will be counted.

filepaths[n] (optional)

An image file from the collection whose colors will be counted.

count_colors[0]

A color which you want to count. Can be entered as either RGB format (255,255,255) or hex format (ffffff).

count_colors[n] (optional)

A color which you want to count.

Request examples

Collection

curl https://multicolorengine.tineye.com/<company>/rest/count_collection_colors/ --get  \
     -d "count_colors[0]=255,112,223"                                                   \
     -d "count_colors[1]=95,136,165"                                                    \
     -d "count_colors[2]=DF4F23"

Metadata

curl https://multicolorengine.tineye.com/<company>/rest/count_collection_colors/ --get          \
     -d "metadata='{\"_and_operator_\": [{\"keywords\": \"dog\"}, {\"keywords\": \"cat\"}]}'"   \
     -d "count_colors[0]=255,112,223"                                                           \
     -d "count_colors[1]=95,136,165"

Colors

curl https://multicolorengine.tineye.com/<company>/rest/count_collection_colors/ --get  \
     -d "colors[0]=212,123,225"                                                         \
     -d "colors[1]=126,135,150"                                                         \
     -d "weights[0]=70"                                                                 \
     -d "weights[1]=30"                                                                 \
     -d "count_colors[0]=255,112,223"

Filepaths

curl https://multicolorengine.tineye.com/<company>/rest/count_collection_colors/ --get  \
     -d "filepaths[0]=path/folder/1.jpg"                                                \
     -d "filepaths[1]=path/folder/3.jpg"                                                \
     -d "count_colors[0]=255,112,223"                                                   \
     -d "count_colors[1]=95,136,165"

Response examples

JSON

{
    "method": "count_collection_colors",
    "status": "ok",
    "error": [],
    "result": [
        {
            "color": [
                105,
                112,
                223
            ],
            "num_images_full_area": 1,
            "num_images_partial_area": 2,
            "class": "blue-light,violet-light"
        },
        {
            "color": [
                95,
                136,
                165
            ],
            "num_images_full_area": 0,
            "num_images_partial_area": 0,
            "class": "blue-light,grey"
        },
        {
            "color": "df4f23",
            "num_images_full_area": 0,
            "num_images_partial_area": 1,
            "class": "orange,red"
        }
    ],
    "stats": {
        "time_count": 56.02,
        "time_total": 56.5
    }
}

XML

<?xml version="1.0" encoding="utf-8"?>
<data>
    <method>count_collection_colors</method>
    <status>ok</status>
    <error/>
    <result>
        <item>
            <color>
                <item>105</item>
                <item>112</item>
                <item>223</item>
            </color>
            <num_images_full_area>1</num_images_full_area>
            <num_images_partial_area>2</num_images_partial_area>
            <class>blue-light,violet-light</class>
        </item>
        <item>
            <color>
                <item>95</item>
                <item>136</item>
                <item>165</item>
            </color>
            <num_images_full_area>0</num_images_full_area>
            <num_images_partial_area>0</num_images_partial_area>
            <class>blue-light,grey</class>
        </item>
        <item>
            <color>df4f23</color>
            <num_images_full_area>0</num_images_full_area>
            <num_images_partial_area>1</num_images_partial_area>
            <class>orange,red</class>
        </item>
    </result>
    <stats>
        <time_count>56.02</time_count>
        <time_total>56.5</time_total>
    </stats>
</data>