ColorPaletteHelper Class
Summary: Helper class for color palettes manipulation.
Module: aspose.psd
Full Name: aspose.psd.ColorPaletteHelper
Aspose.PSD Version: 24.9.0
Methods
Name | Description |
---|---|
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
Type | Description |
---|---|
IColorPalette | The 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:
Parameter | Type | Description |
---|---|---|
min_is_white | bool | if set to |
Returns
Type | Description |
---|---|
IColorPalette | The 4 bit grayscale palette. |
Method: create_8_bit() [static]
create_8_bit()
Creates the 8 bit color palette.
Returns
Type | Description |
---|---|
IColorPalette | The 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:
Parameter | Type | Description |
---|---|---|
min_is_white | bool | if set to |
Returns
Type | Description |
---|---|
IColorPalette | The 8 bit grayscale palette. |
Method: create_monochrome() [static]
create_monochrome()
Creates a monochrome color palette containing 2 colors only.
Returns
Type | Description |
---|---|
IColorPalette | Color 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:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The raster image. |
dest_bounds | Rectangle | The destination image bounds. |
entries_count | int | The desired entries count. |
Returns
Type | Description |
---|---|
IColorPalette | The color palette which starts with the most frequent colors from the |
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:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The raster image. |
dest_bounds | Rectangle | The destination image bounds. |
entries_count | int | The desired entries count. |
use_image_palette | bool | If set, it will use its own image palette if available |
Returns
Type | Description |
---|---|
IColorPalette | The color palette which starts with the most frequent colors from the |
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:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The raster image. |
entries_count | int | The desired entries count. |
Returns
Type | Description |
---|---|
IColorPalette | The color palette which starts with the most frequent colors from the |
Method: get_downscale_palette(image) [static]
get_downscale_palette(image)
Get 256 color palette, composed from upper bits of initial image color values.
Parameters:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The image. |
Returns
Type | Description |
---|---|
ColorPalette | The ColorPalette. |
Method: get_uniform_color_palette(image) [static]
get_uniform_color_palette(image)
Get uniform 256 color palette.
Parameters:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The image. |
Returns
Type | Description |
---|---|
ColorPalette | The ColorPalette. |
Method: has_transparent_colors(palette) [static]
has_transparent_colors(palette)
Determines whether the specified palette has transparent colors.
Parameters:
Parameter | Type | Description |
---|---|---|
palette | IColorPalette | The palette. |
Returns
Type | Description |
---|---|
bool |