Colour analysis#

Tools for describing colour in a way that supports concentration detection: paths through colour space traced by a dye as its concentration changes, ranges and spectra around reference colours, and maps associating labels with colours.

Colour paths, ranges and spectra#

ColorPath([colors, base_color, ...])

Piecewise linear color path in RGB space.

define_color_path(image, mask)

Interactive setup of a color path based on an image.

ColorRange(min_color, max_color[, color_mode])

Class to track the range of colors in an image or a set of images.

DiscreteColorRange(color_range[, resolution])

A ColorRange discretised into a fixed number of bins.

ColorSpectrum(base_color, spectrum, ...)

Data structure to hold a (discrete) color spectrum.

ColorMode(*values)

Whether a colour signal is treated as absolute or relative to a baseline.

get_mean_color(image[, mask])

Calculate the mean color of an image, optionally masked by a boolean mask.

Label-to-colour maps#

LabelColorMap([colors])

Mapping from integer labels to representative RGB colours.

LabelColorPathMap([color_paths])

Mapping between integer labels and their corresponding color paths.

LabelColorSpectrumMap([color_spectra])

Mapping between integer labels and their corresponding color spectra.

LabelColorPathMapRegression(labels, color_range)

Algorithmic definition of relative color paths through regression for labeled images.