Packages

 

com.aspose.cad

Class ColorPaletteHelper



  • public final class ColorPaletteHelper
    extends Object

    Helper class for color palettes manipulation.

    • Method Detail

      • createMonochrome

        public static com.aspose.cad.IColorPalette createMonochrome()

        Creates a monochrome color palette containing 2 colors only.

        Returns:
        Color palette for monochrome images.
      • create4Bit

        public static com.aspose.cad.IColorPalette create4Bit()

        Creates the 4 bit color palette.

        Returns:
        The 4 bit color palette.
      • create4BitGrayscale

        public static com.aspose.cad.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 com.aspose.cad.IColorPalette create8Bit()

        Creates the 8 bit color palette.

        Returns:
        The 8 bit color palette.
      • create8BitGrayscale

        public static com.aspose.cad.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 com.aspose.cad.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_internalized 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 com.aspose.cad.ColorPalette getUniformColorPalette(RasterImage image)

        Get uniform 256 color palette.

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

        public static com.aspose.cad.ColorPalette getDownscalePalette(RasterImage image)

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

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