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, a color name 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). The name is obtained from a list containing thousands of color names extracted from various sources. Each color name is associated with one of the following eleven main color classes: red, pink, orange, green, yellow, blue, violet, brown, grey, black and white.

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 example

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 example

JSON

{
    "status": "ok",
    "error": [],
    "method": "count_collection_colors",
    "result": [
        {
            "color": [
                255,
                112,
                223
            ],
            "num_images_full_area": 1,
            "name": "Pale Magenta",
            "num_images_partial_area": 2,
            "class": "Violet"
        },
        {
            "color": [
                95,
                136,
                165
            ],
            "num_images_full_area": 0,
            "name": "Air Force Blue",
            "num_images_partial_area": 0,
            "class": "Blue"
        },
        {
            "color": "df4f23",
            "num_images_full_area": 0,
            "name": "Cinnabar",
            "num_images_partial_area": 1,
            "class": "Red"
        }
    ]
}

XML

<?xml version="1.0" encoding="utf-8"?>
<data>
    <error/>
    <method>count_collection_colors</method>
    <result>
        <item>
            <class>Violet</class>
            <color>
                <item>255</item>
                <item>112</item>
                <item>223</item>
            </color>
            <name>Pale Magenta</name>
            <num_images_full_area>1</num_images_full_area>
            <num_images_partial_area>2</num_images_partial_area>
        </item>
        <item>
            <class>Blue</class>
            <color>
                <item>95</item>
                <item>136</item>
                <item>165</item>
            </color>
            <name>Air Force Blue</name>
            <num_images_full_area>0</num_images_full_area>
            <num_images_partial_area>0</num_images_partial_area>
        </item>
        <item>
            <class>Red</class>
            <color>df4f23</color>
            <name>Cinnabar</name>
            <num_images_full_area>0</num_images_full_area>
            <num_images_partial_area>1</num_images_partial_area>
        </item>
    </result>
    <status>ok</status>
</data>