ReducePalette - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


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

-

list of colors in formats recognized by ColorTools or a Palette object.

opts

-

(optional) equation(s) of the form option=value where option is either number or space

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

withColorTools:

fullseqColorRGB,1i,i,1i,i=0..1,0.05

fullRGB : 1 0 1,RGB : 0.95 0.05 0.95,RGB : 0.9 0.1 0.9,RGB : 0.85 0.15 0.85,RGB : 0.8 0.2 0.8,RGB : 0.75 0.25 0.75,RGB : 0.7 0.3 0.7,RGB : 0.65 0.35 0.65,RGB : 0.6 0.4 0.6,RGB : 0.55 0.45 0.55,RGB : 0.5 0.5 0.5,RGB : 0.45 0.55 0.45,RGB : 0.4 0.6 0.4,RGB : 0.35 0.65 0.35,RGB : 0.3 0.7 0.3,RGB : 0.25 0.75 0.25,RGB : 0.2 0.8 0.2,RGB : 0.15 0.85 0.15,RGB : 0.1 0.9 0.1,RGB : 0.05 0.95 0.05,RGB : 0 1 0

(5.1)

numelemsfull

21

(5.2)

reducedReducePalettefull

reducedLab : 56.4 91.1 -56.5,Lab : 60.3 98.3 -60.8,Lab : 49.5 55 -35.3,Lab : 51.3 74.8 -46.9,Lab : 50.2 29.1 -19.5,Lab : 53.4 0.00446 -0.00714,Lab : 58.6 -27.7 21.6,Lab : 65.1 -50.2 42.7,Lab : 72.3 -66.6 60.8,Lab : 85.8 -84.2 81.1,Lab : 80 -78 74.1

(5.3)

numelemsreduced

11

(5.4)

imgfilecatkerneloptsdatadir,/images/antennas.jpg:

ImageTools:-EmbedImageTools:-Readimgfile

fullColorsFromImageimgfile:

numelemsfull

226

(5.5)

reducedReducePalettefull

reducedLab : 62.8 -1.33 -14.4,Lab : 21.4 -0.302 11.1,Lab : 73.6 0.0941 24.9,Lab : 48.3 -1.06 10.5,Lab : 91.4 -0.834 2.85,Lab : 58.2 0.733 23.9,Lab : 78.1 -1.56 0.00854,Lab : 34.2 -0.502 10.3,Lab : 64.9 0.0325 7.04,Lab : 83.4 -1.77 9.21,Lab : 54.9 -1.49 -5.23,Lab : 71.3 -1.72 -5.04,Lab : 73.5 -1.44 6.35,Lab : 64.7 -1.15 -1.59,Lab : 56.9 -2.31 10.6,Lab : 40.7 -1.41 11.8,Lab : 67.3 1.03 25.1,Lab : 27.7 -0.271 12.1,Lab : 52.3 3.36 14.6,Lab : 60.4 -1.58 -6.56

(5.6)

reducedReducePalettefull,number=8,space=RGB

reducedRGB : 0.49 0.573 0.667,RGB : 0.224 0.2 0.137,RGB : 0.776 0.703 0.53,RGB : 0.471 0.449 0.38,RGB : 0.907 0.905 0.882,RGB : 0.612 0.541 0.384,RGB : 0.745 0.761 0.757,RGB : 0.337 0.314 0.251

(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/ColorSpaces

ColorTools:-Color

ColorTools:-ColorsFromImage

ColorTools:-Palette

ImageTools