Median cut

from Wikipedia, the free encyclopedia

Median-section (engl. Median cut , in some programs as median section hereinafter) is a sorting process for n-dimensional data. These are gradually subdivided into groups of similar values ​​by dividing a value group at its central value .

The algorithm can be used, among other things, for color reduction in digital images. To do this, it operates on a three-dimensional histogram of the image and produces a balanced distribution of the original colors over the colors of the color-reduced image. The process divides the color space of the image into smaller and smaller cubes until the number of cubes corresponds to the number of desired colors.

literature

  • P. Heckbert, "Color Image Quantization for Frame Buffer Display," Computer Graphics, Vol. 16, no. 3, 1982, pp. 297-307. doi10.1145 / 965145.801294.
  • Anton Kruger, Median-Cut Color Quantization , p. 24f, digitized version (eng.) With sample code