com.sun.jimi.core.util
Class ColorReducer
java.lang.Object
|
+--com.sun.jimi.core.util.ColorReducer
- public class ColorReducer
- extends java.lang.Object
ColorReducer performs color reduction, with optional dithering, on an image to
convert it to use a fixed-size palette. It can reduce the number of colors
used by a palette image, or convert an RGB image to a palette image.
Constructor Summary |
ColorReducer(int maxColors)
Creates a ColorReducer to perform color reduction on an Image without any
dithering. |
ColorReducer(int maxColors,
boolean dither)
Creates a ColorReducer to perform color reduction on an Image. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
reducer_
protected JimiImageColorReducer reducer_
dither_
protected boolean dither_
ColorReducer
public ColorReducer(int maxColors)
- Creates a ColorReducer to perform color reduction on an Image without any
dithering.
- Parameters:
maxColors
- the maximum number of colors in the reduced image
ColorReducer
public ColorReducer(int maxColors,
boolean dither)
- Creates a ColorReducer to perform color reduction on an Image.
- Parameters:
maxColors
- the maximum number of colors in the reduced imagedither
- true if the image should be dithered to create smoother
results
getColorReducedImageProducer
public java.awt.image.ImageProducer getColorReducedImageProducer(java.awt.image.ImageProducer producer)
throws JimiException
- Perform color reduction.
- Parameters:
producer
- the ImageProducer to draw image data from
getColorReducedImageProducer
public java.awt.image.ImageProducer getColorReducedImageProducer(java.awt.Image image)
throws JimiException
- Perform color reduction.
- Parameters:
image
- the Image to draw image data from
getColorReducedImage
public java.awt.Image getColorReducedImage(java.awt.image.ImageProducer producer)
throws JimiException
- Perform color reduction.
- Parameters:
producer
- the ImageProducer to draw image data from
getColorReducedImage
public java.awt.Image getColorReducedImage(java.awt.Image image)
throws JimiException
- Perform color reduction.
- Parameters:
image
- the Image to draw image data from
doColorReduction
protected JimiRasterImage doColorReduction(java.awt.image.ImageProducer producer)
throws JimiException