Package com.day.image
Class Dither
- java.lang.Object
-
- com.day.image.Dither
-
@Deprecated public class Dither extends java.lang.Object
Deprecated.as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.TheDither
provides the dithering capability for reducing colors of an image to 2, 4, 8, 16, 32, 64, 128 or 256 colors. The real number of colors at the end of color reduction depends on the color profile of the image under reduction.Currently the following two dithering algorithm's are supported :
- Simple reduction by reducing the bit width of the color components
- Reduction by reducing the bit width and doing some rudimentary error
correction on neighbouring pixels.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DITHER_NONE
Deprecated.as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.static int
DITHER_SIMPLE_ERROR_CORRECTION
Deprecated.as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.awt.image.BufferedImage
dither(java.awt.image.BufferedImage image, int nCol, long transparency, long bgcolor, int algorithm)
Deprecated.as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.
-
-
-
Field Detail
-
DITHER_NONE
@Deprecated public static final int DITHER_NONE
Deprecated.as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.Indicate the use of the simple bit width color reduction algorithm with no further dithering effects.- See Also:
- Constant Field Values
-
DITHER_SIMPLE_ERROR_CORRECTION
@Deprecated public static final int DITHER_SIMPLE_ERROR_CORRECTION
Deprecated.as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.Indicate the use of the simple bit width color reduction algorithm plus using the simple error correction algorithm.- See Also:
- Constant Field Values
-
-
Method Detail
-
dither
@Deprecated public static java.awt.image.BufferedImage dither(java.awt.image.BufferedImage image, int nCol, long transparency, long bgcolor, int algorithm)
Deprecated.as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.Analize and reduce the number of colors of the given image. Depending on the image and the algorithm, the result may be a new BufferedImage or the same simply returned. If the number of colors in the image is less than required number, no image manipulation is done and the same image is returned.- Parameters:
image
- The BufferedImage to analize for color reductionnCol
- The maximum number of colors allowed in the resulttransparency
- The transparency color of the image or -1 if there is no specific transparency color.bgcolor
- The background color. This - if not -1 - is mixed into the image before reducing colors.algorithm
- Indicate the dithering algorithm to use. Take one of the above constants- Returns:
- The same image if no color reduction is needed or a new one if color reduction was needed.
- See Also:
DITHER_NONE
,DITHER_SIMPLE_ERROR_CORRECTION
-
-