Use color caching during color reduction or not.

Namespace:  AForge.Imaging.ColorReduction
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: (


public bool UseCaching { get; set; }


The property has effect only for methods like ReduceColors(Bitmap, Int32) and specifies if internal cache of already processed colors should be used or not. For each pixel in the original image the color reduction routine does search in target color palette to find the best matching color. To avoid doing the search again and again for already processed colors, the class may use internal dictionary which maps colors of original image to indexes in target color palette.

Note:The property provides a trade off. On one hand it may speedup color reduction routine, but on another hand it increases memory usage. Also cache usage may not be efficient for very small target color tables.

Default value is set to falseFalsefalsefalse (False in Visual Basic).

See Also