language: en pipeline_tag: image-classification task: Image Color Extraction

Image Color Extraction Model

This model performs color extraction from an image using KMeans clustering. Given an input image, the model identifies the dominant colors present in the image and returns their HEX codes, along with the color closest to white.

Model Details:

Input Format:

Output Format:

Usage:

from transformers import pipeline
from PIL import Image

# Load the color extraction pipeline
color_extraction = pipeline("color-extraction")

# Load an image using PIL (Python Imaging Library)
image = Image.open("path/to/your/image.jpg")

# Perform color extraction on the image
colors, closest_to_white = color_extraction(image)

# Print the results
print("Dominant Colors:", colors)
print("Color Closest to White:", closest_to_white)