ColorTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : Packages : ColorTools : Color and Color Object Manipulation Commands : ColorTools/ReducePalette

ColorTools

  

ReducePalette

  

reduce a large list of colors to a smaller, representative list

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

ReducePalette(colors)

Parameters

colors

-

a list of color types understood by color tools or a Palette object

Options

• 

number=positive integer - maximum number of colors to return, 20 by default

• 

space=string - the color space of the output color objects, "Lab" by default

Description

• 

This command reduces a large list of colors down to a small representative list of less than 20 colors.

Examples

with(ColorTools):

full := [seq(Color("RGB", [1-i, i, 1-i]), i=0..1, 0.05)];

module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module

(5.1)

numelems(full);

21

(5.2)

reduced := ReducePalette(full);

module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module

(5.3)

numelems(reduced);

11

(5.4)

imgfile := cat(kernelopts(datadir), "/images/antennas.jpg"):

ImageTools:-Embed(ImageTools:-Read(imgfile));

full := ColorsFromImage(imgfile):

numelems(full);

226

(5.5)

reduced := ReducePalette(full);

module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module

(5.6)

reduced := ReducePalette(full, 'number'=8, 'space'="RGB");

module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module,module...end module

(5.7)

 

Compatibility

• 

The ColorTools[ReducePalette] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

• 

The ColorTools[ReducePalette] command was updated in Maple 2020.

• 

The number and space options were introduced in Maple 2020.

• 

For more information on Maple 2020 changes, see Updates in Maple 2020.

See Also

ColorTools

ColorTools/Color

ColorTools/ColorsFromImage

ColorTools/ColorSpaces

ColorTools/Palette

ImageTools