to.etc.sjit
Class ColorQuantize

java.lang.Object
  extended by to.etc.sjit.ColorQuantize

public class ColorQuantize
extends java.lang.Object


Constructor Summary
ColorQuantize()
           
 
Method Summary
static int[] quantizeImage(int[][] pixels, int max_colors)
          Reduce the image to the given number of colors.
static void reduce(java.awt.image.BufferedImage bi)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorQuantize

public ColorQuantize()
Method Detail

reduce

public static void reduce(java.awt.image.BufferedImage bi)

quantizeImage

public static int[] quantizeImage(int[][] pixels,
                                  int max_colors)
Reduce the image to the given number of colors. The pixels are reduced in place.

Returns:
The new color palette.