Image Color Summarizer

RGB, HSV, LCH & Lab image color statistics and clustering—simple and easy


To automate your analysis, call this script as follows

where IMAGE_URL is the URL of the input image (leading http:// is not necessary).

For this to work your image must be accessible by my server. Make sure you provide the URL to the image and not just to the page that contains the image.

image is resized for analysis

Before it is analyzed, the image is resized—precision controls the width of the resized image. This is done because the code that analyzes the image simply takes too long for large images.

The possible values of PRECISION and the corresponding image size are

The default precision is medium, which resizes the image to 100 pixels. The higher the precision, the longer it takes to process the image.

For example, to obtain a plain-text color summary of this Flickr image using low precision,

# plain-text output, output fields space-separated

color clusters

Use num_clusters=2..10 to specify how many color clusters to report.

If you do not specify num_clusters then the default value num_clusters=5 will be used.

If you set num_clusters=0 then no clustering will be performed.

# no clustering
# 5 clusters

text, xml and JSON output

Use text=1, xml=1, json=1 and jsnop=1 to choose between plain-text, XML, JSON and JSONP output. The JSONP output is the same as JSON except that the output is wrapped in colorsummary() function. The format of the output is explained below.

By default, plain-text output is space-delimited. To obtain tab-delimited output, add tab=1.

# plain-text output, output fields space-separated
# plain-text output, output fields tab-separated
# XML output
# JSON output
# JSONP output

html output

If you omit the text and xml, you will obtain color statistics in a formatted HTML table.

# HTML output

The output will be the same as you obtain if you use the upload form and choose html output.

detailed reporting — histograms and pixel data

Histograms and pixel values are not shown by default. To include these use histogram=1 and/or pixel=1.

# include histogram data

# include pixel data

# include histogram and pixel data

output format

The output plain-text format is designed to be

The output XML format should be self explanatory.