Skip to main content

Hue Palette Size

This rule checks the size of the palette, defined as the number of distinct hue clusters present in the image.

Parameter table

paramunitrequireddescription
minPaletteSizeCountnoMinimum palette size (minPaletteSize)
maxPaletteSizeCountnoMaximum palette size (maxPaletteSize)
hueClusterArcLength°yesMaximum arc length allowed before starting a new cluster (hueClusterArcLength)

Detailed description

The Hue Palette Size rule assesses the diversity of hues present in an image by examining the distribution of colors on the hue wheel. When all hues used in the image are plotted on the hue wheel, distinct clusters of hues represent individual color palettes. The size of the palette is defined as the number of these distinct hue clusters.

To determine the palette size, the rule analyzes the distribution of colors on the hue wheel and creates clusters of adjacent hues, while ensuring that each cluster on the hue wheel does not exceed the specified arc length threshold defined by hueClusterArcLength. This parameter allows for finer control over the clustering of hues. For instance, setting a smaller value for hueClusterArcLength would result in tighter clustering of similar hues, while a larger value would allow for broader distinctions between clusters.

If the difference in hue between two adjacent points exceeds this threshold, they are considered part of different clusters.

Example Hue Wheel Here is an example of a palette (a hue wheel) where we have colored the hues that have been used and grayed out those that are not present in the image. We can see three distinct clusters: one cluster of pink, red, and orange hues (-15° to 30°), a very small cluster of 5° containing yellow hues, and a third cluster spanning 30° (225° to 255°) where we can observe shades of blue.

How to setup

This rule evaluates the size of the palette, represented by the number of distinct hue clusters in the image. Key parameters include:

  • minPaletteSize: Minimum palette size.
  • maxPaletteSize: Maximum palette size.
  • hueClusterArcLength: Maximum arc length allowed before starting a new cluster. This parameter is always required.

Setting a smaller value for hueClusterArcLength would result in tighter clustering of similar hues, while a larger value would allow for broader distinctions between clusters.

At least one of the following parameters is required: minPaletteSize or maxPaletteSize.

Examples

valuevalidhueClusterArcLengthmaxPaletteSizedescription
Luigi304The size of the image's palette should be less than or equal to 4.
Reduced Luigi304The size of the image's palette should be less than or equal to 4.