Package com.day.image

Class Dither

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

@Deprecated public class Dither extends Object
Deprecated.
as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.
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.
    • Field Summary

      Fields
      Modifier and Type
      Field
      Description
      static final int
      Deprecated.
      as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.
      static final int
      Deprecated.
      as of Communiqu� 3.1.0, use com.day.image.DitherOp instead, this class will be removed in the next release.
    • Method Summary

      Modifier and Type
      Method
      Description
      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

      equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Details

      • 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:
      • 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:
    • Method Details

      • dither

        @Deprecated 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: