ReduceColorsMedianCut Function
ImagingFormats

Reduces the number of colors of source.

Pascal
procedure ReduceColorsMedianCut(NumPixels: LongInt; 
                                Src: PByte; 
                                Dst: PByte; 
                                SrcInfo: PImageFormatInfo; 
                                DstInfo: PImageFormatInfo; 
                                MaxColors: LongInt; 
                                ChannelMask: Byte; 
                                DstPal: PPalette32; 
                                Actions: TReduceColorsActions = AllReduceColorsActions);
File

ImagingFormats (at line 63)

Description

Src is bits of source image (ARGB or floating point) and Dst is in some indexed format. MaxColors is the number of colors to which reduce and DstPal is palette to which the resulting colors are written and it must be allocated to at least MaxColors entries. ChannelMask is 'anded' with every pixel's channel value when creating color histogram. If $FF is used all 8bits of color channels are used which can be slow for large images with many colors so you can use lower masks to speed it up.

Related Information
You are here: Symbol Reference > Functions > ReduceColorsMedianCut Function