Squiz Matrix
4.12.2
|
Public Member Functions | |
MedianCut (int[] pixels, int width, int height) | |
MedianCut (ColorProcessor ip) | |
Image | convert (int maxcubes) |
ImageProcessor | convertToByte (int maxcubes) |
Converts an RGB image to 8-bit index color using Heckbert's median-cut color quantization algorithm. Based on median.c by Anton Kruger from the September, 1994 issue of Dr. Dobbs Journal.
Definition at line 11 of file MedianCut.java.
|
inline |
Uses Heckbert's median-cut algorithm to divide the color space defined by
"hist" into "maxcubes" cubes. The centroids (average value) of each cube are are used to create a color table. "hist" is then updated to function as an inverse color map that is used to generate an 8-bit image.
Definition at line 91 of file MedianCut.java.
|
inline |
This is a version of convert that returns a ByteProcessor.
Definition at line 97 of file MedianCut.java.