Ximagic Photoshop plugins
Home Denoiser Quantizer GrayDither ColorDither Purchase Contact

Ximagic Quantizer toolbox


Ximagic Quantizer is a Photoshop plugin for image color quantization (color reduction) & dithering.


  • Predefined palette quantization
  • Custom palette quantization
  • 10 calculated quantization methods.
    • Uniform
    • Popularity
    • Octree
    • Median
    • Xiaolin Wu v2
    • Dennis lee v3
    • Binary Split
    • Lloyd (K-Means)
    • NeuQuant
    • SColorQ
  • 2 error diffusion dither methods.
    • 8 Array patterns (floyd-steinberg, ulichney, fan, jarvis, stucki, sierra).
    • 1 Space filling curve (riemersma)

Support of 8/16 bits images.
Support of Photoshop actions/batch
Support use as Smart filter
Versions for 32 and 64 bit plugin hosts
Mac and Windows versions

Compatible with Paint Shop Pro, The Gimp, IrfanView, XnView, ...

Important: It reduces the number of colors in a image, but doesn't change a RGB image to indexed color. If you want to use it to change an image from RGB to index color, you should use your image tool to change the image mode, after running Ximagic Quantizer.


Color quantization & dithering of images is an old field in image processing. There are a lot of algorithms and implementations, but there is not a method which is the best for everything.

Moreover, color reduction and dithering can be used for several purposes, not only to palletize an image and even to palletize an image the best method can be different for different images or palette size.

Ximagic Quantizer try to include the most known methods of Color quantization and Dithering, and allow the user to choose which one to use.

The available calculated color quantization methods are:

  • Uniform
  • Popularity (Tom Boyle and Andy Lippman- 1978)
  • Median cut (Paul S. Heckbert - 1980)
    The most used method, gives usually a good results and can be used sometimes without dithering.
  • Octree (Gervautz and Purgathofer - 1988)
    Octree algorithm is really a family of algorithms. The one included reduces the tree lowest-population first and can be used in one pass, building and pruning the tree at the same time, or in 2 passes first building the tree and then pruning it. The result of the two pass method is better.
  • Xiaolin Wu v2 (Xiaolin Wu 1992)
    Greedy orthogonal bipartition of RGB space for variance minimization aided by inclusion-exclusion tricks. (Author's description)
  • Dennis Lee v3 ( (C) Dennis Lee 1997)
    A 2-pass color Quantizer that uses an exhaustive search technique to minimize error introduced at each step during palData reduction. (Author's description)
  • Binary Split (Orchard and Bouman 1991)
  • Lloyd algorithm (K-Means) (S. Lloyd 1957)
  • NeuQuant ( (C) Anthony Dekker 1994)
    Method using Kohonen self organizing maps. Usually the best one according to RMSE.
  • SColorQ (Spatial Color Quantization - Jan Puzicha et all 1998)
    Method for simultaneous quantization and dithering. Very good for small palettes, 16 colors or less, when other methods even with dithering don't work well.

Note: All methods excluding SColorQ give the same result for the same image and parameters. SColorQ starts with a initial palette filled with random values, which change with time, and so it gives different results in each run.

The available error dithering methods are:

  • Error Diffusion
    • Floyd-Steinberg
    • Ulichney
    • Fan
    • Jarvis
    • Stucki
    • Sierra3
    • Sierra2
    • Sierra24A
  • Space filling curves
    • Riemersma

The plugin could also calculate RMSE (Root Mean Squared Error). Although this value is not equivalent to visual quality, it is generally accepted as a good measure of the quality. To get the RMSE mark the "calculate RMSE" check.

RMSE measures of different methods applied to the standard Lena image could be found here

The quantization & dithering can be processed in RGB or YCbCr colorspace. Quantization & dithering algorithms use the distance between colors to work. In RGB colorspace the Euclidean distance between colors doesn't represent the perceptual distance. In YCbCr or CIELab the Euclidean distance is a more approximate measure of difference. In the near future a CIELab option will be provided.

Questions, suggestions and bug reports

Comments are welcomed. Please e-mail to support@ximagic.com

Thanks, reused code & copyrights

This application reuses some published color quantization code, without which the work needed to develop it increases several orders of magnitude.
I wish to thanks the Authors or Publishers (in order of appearance)

  • Dean Clark [Octree method]
  • Anton Kruger [Median method]
  • Xiaolin Wu [Wu method]
  • Benny_land (publisher)/ Dennis Lee (Author) [Dennis Lee method]
  • Maffi Leonardo (publisher)/ Roger Zhang (Author) [K-Means method]
  • Charles A. Bouman [Binary split method]
  • Anthony Dekker [NeuQuant method]
  • Derrick Coetzee [Spatial method]
  • ImageMagick [Ordered Dithering]
  • Thiadmer Riemersma [Riemersma dithering]
  • Libpipi [Direct Binary Search]
  • TinyXML parser

To see the detail of code used and the copyrights go to License