Color

The 'Color' model returns density values for dominant colors present in images. Color predictions are returned in hex format and also mapped to their closest W3C counterparts. This model is great for anyone building an app where color is an important distinguisher.

GO TO DOCUMENTATION Updated May 11, 2016

Demo

Info

Info

MODEL NAME

Color

OWNER

Clarifai

MODEL ID

eeed0b6733a644cea07cf4c60f87ebb7

UPDATED AT

May 11, 2016

CONCEPTS

Black, Blue, Orange, Purple, Red, White and more

Request

You can call the Predict API with the 'Color' model. Simply pass in an image input with a publicly accessible URL or by directly sending image bytes.

You can learn more about the Predict API in our API Guide.

POST
curl -X POST
    -H 'Authorization: Bearer {access_token}'
    -H "Content-Type: application/json"
    -d '
    {
      "inputs": [
        {
          "data": {
            "image": {
              "url": "https://samples.clarifai.com/metro-north.jpg"
            }
          }
        }
      ]
    }'
    https://api.clarifai.com/v2/models/eeed0b6733a644cea07cf4c60f87ebb7/outputs

Response

The Predict API returns the dominant colors present in the image. The predictions include the hex code, the density of the color in the given image, and the closest W3C color name for each identified color.

Response
{
  "status": {
    "code": 10000,
    "description": "Ok"
  },
  "outputs": [
    {
      "id": "a23850cfef834671b4010d566c4923ae",
      "status": {
        "code": 10000,
        "description": "Ok"
      },
      "created_at": "2016-11-22T17:31:21Z",
      "model": {
        "name": "color",
        "id": "eeed0b6733a644cea07cf4c60f87ebb7",
        "created_at": "2016-05-11T18:05:45Z",
        "app_id": null,
        "output_info": {
          "message": "Show output_info with: GET /models/{model_id}/output_info",
          "type": "color"
        },
        "model_version": {
          "id": "dd9458324b4b45c2be1a7ba84d27cd04",
          "created_at": "2016-07-13T01:19:12Z",
          "status": {
            "code": 21100,
            "description": "Model trained successfully"
          }
        }
      },
      "input": {
        "id": "a23850cfef834671b4010d566c4923ae",
        "data": {
          "image": {
            "url": "https://samples.clarifai.com/metro-north.jpg"
          }
        }
      },
      "data": {
        "colors": [
          {
            "raw_hex": "#513f2c",
            "w3c": {
              "hex": "#696969",
              "name": "DimGray"
            },
            "value": 0.14725
          },
          {
            "raw_hex": "#7298e2",
            "w3c": {
              "hex": "#6495ed",
              "name": "CornflowerBlue"
            },
            "value": 0.31575
          },
          {
            "raw_hex": "#1e181b",
            "w3c": {
              "hex": "#000000",
              "name": "Black"
            },
            "value": 0.20175
          },
          {
            "raw_hex": "#8f714b",
            "w3c": {
              "hex": "#d2b48c",
              "name": "Tan"
            },
            "value": 0.1125
          },
          {
            "raw_hex": "#d2c275",
            "w3c": {
              "hex": "#bdb76b",
              "name": "DarkKhaki"
            },
            "value": 0.017
          },
          {
            "raw_hex": "#141b3c",
            "w3c": {
              "hex": "#000000",
              "name": "Black"
            },
            "value": 0.12
          },
          {
            "raw_hex": "#404b84",
            "w3c": {
              "hex": "#483d8b",
              "name": "DarkSlateBlue"
            },
            "value": 0.0705
          },
          {
            "raw_hex": "#e5e1cc",
            "w3c": {
              "hex": "#faebd7",
              "name": "AntiqueWhite"
            },
            "value": 0.01525
          }
        ]
      }
    }
  ]
}
SHOW FULL CODE
COMPONENTDESCRIPTION
modelThe model you are using to make predictions on your inputs with. Includes the id, name, created_at date, output info, and information on the model version.
inputThe image data that you passed through the model to make predictions. Includes id and the image data.
dataThe data sent back with the reponse; usually includes the detected concepts and corresponding probability values. (If the model's output type is not concepts, you'll see different output responses here.)

Info

MODEL NAME

Color

OWNER

Clarifai

MODEL ID

eeed0b6733a644cea07cf4c60f87ebb7

UPDATED AT

May 11, 2016

CONCEPTS

Black, Blue, Orange, Purple, Red, White and more

Get Started for Free with Color Model

Start building amazing stuff — no credit card required.

Get Your Free API Key