Dominant color extraction

An ML model that extracts the most prominent colors in an image

Overview

The model analyzes the colors present in the input image and determines if they fall into several predefined ranges. It then compares the number of pixels in those ranges and outputs color names that were detected as visually dominant.

The pixels of the image are examined to identify the most prominent colors present. Multiple factors such as the distribution and frequency of different color values are taken into account to determine the dominant colors.

To find the color of a pixel, all values in the image are converted to an alternative color representation that is designed to be more closely aligned with the way human vision perceives colors. This enures high-quality results.

Use cases

Some typical use cases for this model include:

  • Visual search and filtering - Users can search for images based on specific dominant color criteria. For example, they can search for images dominated by a particular color to find assets that align with a specific theme or aesthetic.

  • Color-based categorization - The feature facilitates the automatic categorization of images based on their dominant colors. This allows for easier location and grouping of images with similar color schemes.

  • Branding Enhancement - Teams can utilize the dominant color information to ensure consistent branding and visual coherence. They can search for images that match their brand identity and integrate them into their campaigns.

API endpoints

An up-to-date reference with all API endpoints is available here:

Example API responses

Product imageAPI response
{
    "status": "success",
    "version": "2.9.3",
    "sha1": "f87f1c2e708b1111aa8aa99640efec02aaeb130b",
    "request_uuid": "0e00fce5-19a5-4411-b161-6894f9a7ff8e",
    "file_downloaded": "grahame-jenkins-p7tai9P7H-s-unsplash.jpg",
    "dominant_colors": [
        {
            "color": "azure",
            "hex": "0980fb",
            "pixels": 402721,
            "ratio": 0.16,
            "all": 2453760
        }
    ],
    "main_colors": [
        "azure"
    ],
    "main_colors_ratio": [
        0.16
    ],
    "main_colors_pixels": [
        402721
    ],
    "main_colors_hex": [
        "0980fb"
    ]
}
{
    "status": "success",
    "version": "2.9.3",
    "sha1": "cb29b29a902db664cb3bcb83a593d5dc7e0ae06f",
    "request_uuid": "e7ca3fd3-5561-4b48-adf3-4df8120e48c3",
    "file_downloaded": "420799-MF-MELON_RED.jpg",
    "dominant_colors": [
        {
            "color": "pink",
            "hex": "ee6893",
            "pixels": 293000,
            "ratio": 0.05,
            "all": 6220800
        }
    ],
    "main_colors": [
        "pink"
    ],
    "main_colors_ratio": [
        0.05
    ],
    "main_colors_pixels": [
        293000
    ],
    "main_colors_hex": [
        "ee6893"
    ]
}

Last updated