com.day.image
Class Dither

java.lang.Object
  extended by com.day.image.Dither

Deprecated. as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.

public class Dither
extends Object

The Dither 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 :

    1. 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.

        Version:
        $Revision$, $Date: 2007-04-17 16:41:22 +0200 (Di, 17. Apr 2007) $
        Author:
        fmeschbe, based on CQ2's rgba2/rgbacolor.c color reduction

        Field Summary
        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
        static BufferedImage dither(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.
         
        Methods inherited from class java.lang.Object
        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
         

        Field Detail

        DITHER_NONE

        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

        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

        public static BufferedImage dither(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 reduction
        nCol - The maximum number of colors allowed in the result
        transparency - 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


        Copyright © 2011-2012 Adobe Systems Incorporated. All Rights Reserved.