Packages

 

com.aspose.cad

Class ColorPaletteHelper



  • public class ColorPaletteHelper
    extends Object

    Helper class for color palettes manipulation.

    • Constructor Detail

      • ColorPaletteHelper

        public ColorPaletteHelper()
    • Method Detail

      • createMonochrome

        public static IColorPalette createMonochrome()

        Creates a monochrome color palette containing 2 colors only.

        Returns:
        Color palette for monochrome images.
      • create4Bit

        public static IColorPalette create4Bit()

        Creates the 4 bit color palette.

        Returns:
        The 4 bit color palette.
      • create4BitGrayscale

        public static IColorPalette create4BitGrayscale(boolean minIsWhite)

        Creates the 4 bit grayscale palette.

        Parameters:
        minIsWhite - if set to true the palette starts with white color, otherwise it starts with black color.
        Returns:
        The 4 bit grayscale palette.
      • create8Bit

        public static IColorPalette create8Bit()

        Creates the 8 bit color palette.

        Returns:
        The 8 bit color palette.
      • create8BitGrayscale

        public static IColorPalette create8BitGrayscale(boolean minIsWhite)

        Creates the 8 bit grayscale palette.

        Parameters:
        minIsWhite - if set to true the palette starts with white color, otherwise it starts with black color.
        Returns:
        The 8 bit grayscale palette.
      • getCloseImagePalette

        public static IColorPalette getCloseImagePalette(RasterImage image,
                                         int entriesCount)

        Gets color palette from raster image (palletizes image) in case the image does not have one. In case palette exists it will be used instead performing calculations.

        Parameters:
        image - The raster image.
        entriesCount - The desired entries count.
        Returns:
        The color palette which starts with the most frequent colors from the image and contains entriesCount entries.
      • getUniformColorPalette

        public static ColorPalette getUniformColorPalette(RasterImage image)

        Get uniform 256 color palette.

        Parameters:
        image - The image.
        Returns:
        The ColorPalette.
      • getDownscalePalette

        public static ColorPalette getDownscalePalette(RasterImage image)

        Get 256 color palette, composed from upper bits of initial image color values.

        Parameters:
        image - The image.
        Returns:
        The ColorPalette.