org.xith3d.utility.image
Class Quantize

java.lang.Object
  extended by org.xith3d.utility.image.Quantize

public class Quantize
extends java.lang.Object


Constructor Summary
Quantize()
           
 
Method Summary
static java.awt.image.BufferedImage quantize(java.awt.image.BufferedImage source, int max_colors)
          Takes a buffered image and reduces the colors to the specified number
static int[] quantizeImage(int[][] pixels, int max_colors)
          Reduce the image to the given number of colors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Quantize

public Quantize()
Method Detail

quantize

public static java.awt.image.BufferedImage quantize(java.awt.image.BufferedImage source,
                                                    int max_colors)
                                             throws java.io.IOException
Takes a buffered image and reduces the colors to the specified number

Throws:
java.io.IOException

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.