# greedycoloring¶

Syntax: greedycoloring(image, connectivity)

Perform greedy coloring of regions. Colors each region in image such that its neighbours are colored with different colors, and uses as little colors as possible. Uses greedy algorithm so the count of colors used might not be minimal. Assumes background to have value 0 and colors all non-zero regions.

This command cannot be used in the distributed processing mode. If you need it, please contact the authors.

## Arguments¶

### image [input & output]¶

Data type: uint8 image, uint16 image, uint32 image, uint64 image, int8 image, int16 image, int32 image, int64 image, float32 image

Image to process.

### connectivity [input]¶

Data type: connectivity

Default value: All

Connectivity of the regions. Can be Nearest for connectivity to nearest neighbours only, or All for connectivity to all neighbours.