ColorPaletteHelper Class

Summary: Helper class for color palettes manipulation.

Module: aspose.psd

Full Name: aspose.psd.ColorPaletteHelper

Aspose.PSD Version: 24.9.0

Methods

NameDescription
create_4_bit()Creates the 4 bit color palette.
create_4_bit_grayscale(min_is_white)Creates the 4 bit grayscale palette.
create_8_bit()Creates the 8 bit color palette.
create_8_bit_grayscale(min_is_white)Creates the 8 bit grayscale palette.
create_monochrome()Creates a monochrome color palette containing 2 colors only.
get_close_image_palette(image, dest_bounds, entries_count)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.
get_close_image_palette(image, dest_bounds, entries_count, use_image_palette)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.
get_close_image_palette(image, entries_count)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.
get_downscale_palette(image)Get 256 color palette, composed from upper bits of initial image color values.
get_uniform_color_palette(image)Get uniform 256 color palette.
has_transparent_colors(palette)Determines whether the specified palette has transparent colors.

Method: create_4_bit() [static]

 create_4_bit() 

Creates the 4 bit color palette.

Returns

TypeDescription
IColorPaletteThe 4 bit color palette.

Method: create_4_bit_grayscale(min_is_white) [static]

 create_4_bit_grayscale(min_is_white) 

Creates the 4 bit grayscale palette.

Parameters:

ParameterTypeDescription
min_is_whiteboolif set to true the palette starts with white color, otherwise it starts with black color.

Returns

TypeDescription
IColorPaletteThe 4 bit grayscale palette.

Method: create_8_bit() [static]

 create_8_bit() 

Creates the 8 bit color palette.

Returns

TypeDescription
IColorPaletteThe 8 bit color palette.

Method: create_8_bit_grayscale(min_is_white) [static]

 create_8_bit_grayscale(min_is_white) 

Creates the 8 bit grayscale palette.

Parameters:

ParameterTypeDescription
min_is_whiteboolif set to true the palette starts with white color, otherwise it starts with black color.

Returns

TypeDescription
IColorPaletteThe 8 bit grayscale palette.

Method: create_monochrome() [static]

 create_monochrome() 

Creates a monochrome color palette containing 2 colors only.

Returns

TypeDescription
IColorPaletteColor palette for monochrome images.

Method: get_close_image_palette(image, dest_bounds, entries_count) [static]

 get_close_image_palette(image, dest_bounds, entries_count) 

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:

ParameterTypeDescription
imageRasterImageThe raster image.
dest_boundsRectangleThe destination image bounds.
entries_countintThe desired entries count.

Returns

TypeDescription
IColorPaletteThe color palette which starts with the most frequent colors from the and contains entries.

Method: get_close_image_palette(image, dest_bounds, entries_count, use_image_palette) [static]

 get_close_image_palette(image, dest_bounds, entries_count, use_image_palette) 

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:

ParameterTypeDescription
imageRasterImageThe raster image.
dest_boundsRectangleThe destination image bounds.
entries_countintThe desired entries count.
use_image_paletteboolIf set, it will use its own image palette if available

Returns

TypeDescription
IColorPaletteThe color palette which starts with the most frequent colors from the and contains entries.

Method: get_close_image_palette(image, entries_count) [static]

 get_close_image_palette(image, entries_count) 

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:

ParameterTypeDescription
imageRasterImageThe raster image.
entries_countintThe desired entries count.

Returns

TypeDescription
IColorPaletteThe color palette which starts with the most frequent colors from the and contains entries.

Method: get_downscale_palette(image) [static]

 get_downscale_palette(image) 

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

Parameters:

ParameterTypeDescription
imageRasterImageThe image.

Returns

TypeDescription
ColorPaletteThe ColorPalette.

Method: get_uniform_color_palette(image) [static]

 get_uniform_color_palette(image) 

Get uniform 256 color palette.

Parameters:

ParameterTypeDescription
imageRasterImageThe image.

Returns

TypeDescription
ColorPaletteThe ColorPalette.

Method: has_transparent_colors(palette) [static]

 has_transparent_colors(palette) 

Determines whether the specified palette has transparent colors.

Parameters:

ParameterTypeDescription
paletteIColorPaletteThe palette.

Returns

TypeDescription
booltrue if the specified palette has transparent colors; otherwise, false.