Detect Main Image Color

Detect the main color of an image. The API returns a list of colors and their hex codes. The API supports images in the following formats: JPEG, PNG, and GIF.

The detected colors are given in hex code and their specific and main color (color family) names.

GET
https://api.apileague.com/detect-color
Example Request and Response
GET
https://api.apileague.com/{{ examples.getDetectMainImageColor }}
[
    {
        "hex_code": "#b01c20",
        "specific_color": "Firebrick",
        "main_color": "Red"
    },
    {
        "hex_code": "#bfaf9a",
        "specific_color": "Thistle Green",
        "main_color": "Green"
    },
    {
        "hex_code": "#36180d",
        "specific_color": "Brown Pod",
        "main_color": "Brown"
    }
]
cURL
Java
Javascript
Python
Go
C#
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}