CmykColorHelper Class

Summary: Helper methods to work with CMYK color presented as a signed 32-bit integer value.
Provides the similar API as the CmykColor struct.
It’s more lightweight because CMYK color is presented just as Int32 rather than structure with internal fields.
Please prefer to use static methods of this class when possible instead of the deprecated
CmykColor struct.

Module: aspose.imaging

Full Name: aspose.imaging.CmykColorHelper

Methods

NameDescription
argb_32_to_cmyk(argb)The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
argb_32_to_cmyk_array(pixels)The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
argb_32_to_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
argb_32_to_cmyk_with_icc(argb, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.
argb_32_to_psd_cmyk(argb)The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.
argb_32_to_psd_cmyk_array(pixels)The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.
argb_32_to_psd_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.
argb_32_to_psd_cmyk_with_icc(pixel, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.
from_components(cyan, magenta, yellow, black)Creates CMYK from a 32-bit cyan, magenta, yellow and black values.
get_c(cmyk)Gets the cyan component value.
get_k(cmyk)Gets the black component value.
get_m(cmyk)Gets the magenta component value.
get_y(cmyk)Gets the yellow component value.
to_argb(cmyk_pixel)The conversion from CMYK colors to ARGB colors.
to_argb(cmyk_pixels)The conversion from CMYK colors to ARGB colors.
to_argb32(cmyk_pixels)The conversion from CMYK colors to ARGB colors.
to_argb_color(cmyk_pixel)The conversion from CMYK colors to ARGB colors.
to_argb_color_with_def_icc(cmyk_pixel)The conversion from CMYK color to ARGB Color using Icc conversion with default profiles.
to_argb_color_with_icc(cmyk_pixel, cmyk_icc_stream, rgb_icc_stream)The conversion from CMYK color to ARGB color using Icc conversion with custom profile.
to_argb_colors(cmyk_pixels)The conversion from CMYK colors to ARGB colors.
to_argb_colors_with_def_icc(cmyk_pixels)The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.
to_argb_colors_with_icc(cmyk_pixels, cmyk_icc_stream, rgb_icc_stream)The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.
to_argb_icc(cmyk_pixel)The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.
to_argb_icc(cmyk_pixel, cmyk_icc_stream, rgb_icc_stream)The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.
to_argb_icc(cmyk_pixels)The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.
to_argb_icc(cmyk_pixels, cmyk_icc_stream, rgb_icc_stream)The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.
to_cmyk(argb_pixel)The conversion from ARGB colors to CMYK colors.
to_cmyk(argb_pixels)The conversion from ARGB colors to CMYK colors.
to_cmyk(pixel)The conversion from ARGB colors to CMYK colors.
to_cmyk(pixels)The conversion from ARGB colors to CMYK colors.
to_cmyk_array(argb_pixels)The conversion from ARGB colors to CMYK colors.
to_cmyk_array_with_def_icc(pixels)The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
to_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
to_cmyk_bytes(argb_pixels, start_index, length)Converts ARGB to CMYK.
to_cmyk_color(pixel)The conversion from ARGB color to CMYK color.
to_cmyk_colors(pixels)The conversion from ARGB colors to CMYK colors.
to_cmyk_icc(argb)The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
to_cmyk_icc(argb, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.
to_cmyk_icc(pixel)The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
to_cmyk_icc(pixel, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
to_cmyk_icc(pixels)The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
to_cmyk_icc(pixels)The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
to_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
to_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
to_cmyk_icc_bytes(pixels, start_index, length, rgb_icc_stream, cmyk_icc_stream)Converts RGB to CMYK using custom ICC profiles.
to_cmyk_with_def_icc(pixel)The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
to_cmyk_with_icc(pixel, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.
to_cmyka_bytes(argb_pixels, start_index, length)Converts ARGB to CMYKA (with transparency).
to_cmyka_icc_bytes(pixels, start_index, length, rgb_icc_stream, cmyk_icc_stream)Converts RGB to CMYKA (with alpha) using custom ICC profiles.
to_psd_cmyk_icc(argb)The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.
to_psd_cmyk_icc(pixel, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.
to_psd_cmyk_icc(pixels)The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.
to_psd_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream)The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Method: argb_32_to_cmyk(argb) [static]

 argb_32_to_cmyk(argb) 

The conversion from ARGB color to CMYK color using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
argbintThe ARGB color.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: argb_32_to_cmyk_array(pixels) [static]

 argb_32_to_cmyk_array(pixels) 

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: argb_32_to_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream) [static]

 argb_32_to_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: argb_32_to_cmyk_with_icc(argb, rgb_icc_stream, cmyk_icc_stream) [static]

 argb_32_to_cmyk_with_icc(argb, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
argbintThe ARGB color.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: argb_32_to_psd_cmyk(argb) [static]

 argb_32_to_psd_cmyk(argb) 

The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Parameters:

ParameterTypeDescription
argbintThe ARGB color.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value in KCMY byte order with inverted channel values.

Method: argb_32_to_psd_cmyk_array(pixels) [static]

 argb_32_to_psd_cmyk_array(pixels) 

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

Method: argb_32_to_psd_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream) [static]

 argb_32_to_psd_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

Method: argb_32_to_psd_cmyk_with_icc(pixel, rgb_icc_stream, cmyk_icc_stream) [static]

 argb_32_to_psd_cmyk_with_icc(pixel, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
pixelintThe ARGB color.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

Method: from_components(cyan, magenta, yellow, black) [static]

 from_components(cyan, magenta, yellow, black) 

Creates CMYK from a 32-bit cyan, magenta, yellow and black values.

Parameters:

ParameterTypeDescription
cyanintThe cyan component. Valid values are 0 through 255.
magentaintThe magenta component. Valid values are 0 through 255.
yellowintThe yellow component. Valid values are 0 through 255.
blackintThe black component. Valid values are 0 through 255.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: get_c(cmyk) [static]

 get_c(cmyk) 

Gets the cyan component value.

Parameters:

ParameterTypeDescription
cmykintThe CMYK color presented as a 32-bit integer value.

Returns

TypeDescription
intThe cyan component value.

See also:

Example # 1: The following example shows how to convert RGB colors to their CMYK counterpa…

Method: get_k(cmyk) [static]

 get_k(cmyk) 

Gets the black component value.

Parameters:

ParameterTypeDescription
cmykintThe CMYK color presented as a 32-bit integer value.

Returns

TypeDescription
intThe black component value.

See also:

Example # 1: The following example shows how to convert RGB colors to their CMYK counterpa…

Method: get_m(cmyk) [static]

 get_m(cmyk) 

Gets the magenta component value.

Parameters:

ParameterTypeDescription
cmykintThe CMYK color presented as a 32-bit integer value.

Returns

TypeDescription
intThe magenta component value.

See also:

Example # 1: The following example shows how to convert RGB colors to their CMYK counterpa…

Method: get_y(cmyk) [static]

 get_y(cmyk) 

Gets the yellow component value.

Parameters:

ParameterTypeDescription
cmykintThe CMYK color presented as a 32-bit integer value.

Returns

TypeDescription
intThe yellow component value.

See also:

Example # 1: The following example shows how to convert RGB colors to their CMYK counterpa…

Method: to_argb(cmyk_pixel) [static]

 to_argb(cmyk_pixel) 

The conversion from CMYK colors to ARGB colors.

Parameters:

ParameterTypeDescription
cmyk_pixelint

Returns

TypeDescription
ColorThe ARGB colors.

Method: to_argb(cmyk_pixels) [static]

 to_argb(cmyk_pixels) 

The conversion from CMYK colors to ARGB colors.

Parameters:

ParameterTypeDescription
cmyk_pixelsintThe CMYK colors presented as 32-bit integer values.

Returns

TypeDescription
Color[]The ARGB colors.

Method: to_argb32(cmyk_pixels) [static]

 to_argb32(cmyk_pixels) 

The conversion from CMYK colors to ARGB colors.

Parameters:

ParameterTypeDescription
cmyk_pixelsintThe CMYK colors presented as 32-bit integer values.

Returns

TypeDescription
intThe ARGB colors presented as 32-bit integer values.

Method: to_argb_color(cmyk_pixel) [static]

 to_argb_color(cmyk_pixel) 

The conversion from CMYK colors to ARGB colors.

Parameters:

ParameterTypeDescription
cmyk_pixelint

Returns

TypeDescription
ColorThe ARGB colors.

Method: to_argb_color_with_def_icc(cmyk_pixel) [static]

 to_argb_color_with_def_icc(cmyk_pixel) 

The conversion from CMYK color to ARGB Color using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
cmyk_pixelintThe CMYK color presented as a 32-bit integer value.

Returns

TypeDescription
ColorThe ARGB color.

Method: to_argb_color_with_icc(cmyk_pixel, cmyk_icc_stream, rgb_icc_stream) [static]

 to_argb_color_with_icc(cmyk_pixel, cmyk_icc_stream, rgb_icc_stream) 

The conversion from CMYK color to ARGB color using Icc conversion with custom profile.

Parameters:

ParameterTypeDescription
cmyk_pixelintThe CMYK color presented as a 32-bit integer value.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.

Returns

TypeDescription
ColorThe ARGB color.

Method: to_argb_colors(cmyk_pixels) [static]

 to_argb_colors(cmyk_pixels) 

The conversion from CMYK colors to ARGB colors.

Parameters:

ParameterTypeDescription
cmyk_pixelsintThe CMYK colors presented as 32-bit integer values.

Returns

TypeDescription
Color[]The ARGB colors.

Method: to_argb_colors_with_def_icc(cmyk_pixels) [static]

 to_argb_colors_with_def_icc(cmyk_pixels) 

The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
cmyk_pixelsintThe CMYK pixels presented as 32-bit integer values.

Returns

TypeDescription
Color[]The ARGB colors.

Method: to_argb_colors_with_icc(cmyk_pixels, cmyk_icc_stream, rgb_icc_stream) [static]

 to_argb_colors_with_icc(cmyk_pixels, cmyk_icc_stream, rgb_icc_stream) 

The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
cmyk_pixelsintThe CMYK colors presented as 32-bit integer values.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.

Returns

TypeDescription
Color[]The ARGB colors.

Method: to_argb_icc(cmyk_pixel) [static]

 to_argb_icc(cmyk_pixel) 

The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
cmyk_pixelint

Returns

TypeDescription
ColorThe ARGB colors.

Method: to_argb_icc(cmyk_pixel, cmyk_icc_stream, rgb_icc_stream) [static]

 to_argb_icc(cmyk_pixel, cmyk_icc_stream, rgb_icc_stream) 

The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
cmyk_pixelint
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.

Returns

TypeDescription
ColorThe ARGB colors.

Method: to_argb_icc(cmyk_pixels) [static]

 to_argb_icc(cmyk_pixels) 

The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
cmyk_pixelsintThe CMYK pixels presented as 32-bit integer values.

Returns

TypeDescription
Color[]The ARGB colors.

Method: to_argb_icc(cmyk_pixels, cmyk_icc_stream, rgb_icc_stream) [static]

 to_argb_icc(cmyk_pixels, cmyk_icc_stream, rgb_icc_stream) 

The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
cmyk_pixelsintThe CMYK colors presented as 32-bit integer values.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.

Returns

TypeDescription
Color[]The ARGB colors.

Method: to_cmyk(argb_pixel) [static]

 to_cmyk(argb_pixel) 

The conversion from ARGB colors to CMYK colors.

Parameters:

ParameterTypeDescription
argb_pixelint

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk(argb_pixels) [static]

 to_cmyk(argb_pixels) 

The conversion from ARGB colors to CMYK colors.

Parameters:

ParameterTypeDescription
argb_pixelsintThe ARGB colors presented as 32-bit integer values.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

See also:

Example # 1: The following example shows how to convert RGB colors to their CMYK counterpa…

Method: to_cmyk(pixel) [static]

 to_cmyk(pixel) 

The conversion from ARGB colors to CMYK colors.

Parameters:

ParameterTypeDescription
pixelColor

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

See also:

Example # 1: The following example fills the central area of a raster image with black pix…

Method: to_cmyk(pixels) [static]

 to_cmyk(pixels) 

The conversion from ARGB colors to CMYK colors.

Parameters:

ParameterTypeDescription
pixelsColor[]

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_array(argb_pixels) [static]

 to_cmyk_array(argb_pixels) 

The conversion from ARGB colors to CMYK colors.

Parameters:

ParameterTypeDescription
argb_pixelsintThe ARGB colors presented as 32-bit integer values.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_array_with_def_icc(pixels) [static]

 to_cmyk_array_with_def_icc(pixels) 

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
pixelsColor[]The ARGB colors.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyk_array_with_icc(pixels, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
pixelsColor[]The ARGB colors.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_bytes(argb_pixels, start_index, length) [static]

 to_cmyk_bytes(argb_pixels, start_index, length) 

Converts ARGB to CMYK.

Parameters:

ParameterTypeDescription
argb_pixelsintThe RGB colors presented as 32-bit integer values.
start_indexintThe start index of RGB color.
lengthintThe number of RGB pixels to convert.

Returns

TypeDescription
byteThe CMYK colors presented as a byte array.

Method: to_cmyk_color(pixel) [static]

 to_cmyk_color(pixel) 

The conversion from ARGB color to CMYK color.

Parameters:

ParameterTypeDescription
pixelColorThe ARGB color.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: to_cmyk_colors(pixels) [static]

 to_cmyk_colors(pixels) 

The conversion from ARGB colors to CMYK colors.

Parameters:

ParameterTypeDescription
pixelsColor[]The ARGB colors.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_icc(argb) [static]

 to_cmyk_icc(argb) 

The conversion from ARGB color to CMYK color using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
argbintThe ARGB color.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: to_cmyk_icc(argb, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyk_icc(argb, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
argbintThe ARGB color.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: to_cmyk_icc(pixel) [static]

 to_cmyk_icc(pixel) 

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
pixelColor

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_icc(pixel, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyk_icc(pixel, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
pixelColor
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_icc(pixels) [static]

 to_cmyk_icc(pixels) 

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
pixelsColor[]The ARGB colors.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_icc(pixels) [static]

 to_cmyk_icc(pixels) 

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
pixelsColor[]The ARGB colors.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values.

Method: to_cmyk_icc_bytes(pixels, start_index, length, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyk_icc_bytes(pixels, start_index, length, rgb_icc_stream, cmyk_icc_stream) 

Converts RGB to CMYK using custom ICC profiles.

Parameters:

ParameterTypeDescription
pixelsintThe RGB colors presented as 32-bit integer values.
start_indexintThe start index of RGB color.
lengthintThe number of RGB pixels to convert.
rgb_icc_stream_io.BufferedRandomThe RGB profile stream.
cmyk_icc_stream_io.BufferedRandomThe CMYK profile stream.

Returns

TypeDescription
byteThe CMYK colors presented as a byte array.

Method: to_cmyk_with_def_icc(pixel) [static]

 to_cmyk_with_def_icc(pixel) 

The conversion from ARGB color to CMYK color using Icc conversion with default profiles.

Parameters:

ParameterTypeDescription
pixelColorThe ARGB color.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: to_cmyk_with_icc(pixel, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyk_with_icc(pixel, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.

Parameters:

ParameterTypeDescription
pixelColorThe ARGB color.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value.

Method: to_cmyka_bytes(argb_pixels, start_index, length) [static]

 to_cmyka_bytes(argb_pixels, start_index, length) 

Converts ARGB to CMYKA (with transparency).

Parameters:

ParameterTypeDescription
argb_pixelsintThe RGB colors presented as 32-bit integer values.
start_indexintThe start index of RGB color.
lengthintThe number of RGB pixels to convert.

Returns

TypeDescription
byteThe CMYK colors presented as a byte array.

Method: to_cmyka_icc_bytes(pixels, start_index, length, rgb_icc_stream, cmyk_icc_stream) [static]

 to_cmyka_icc_bytes(pixels, start_index, length, rgb_icc_stream, cmyk_icc_stream) 

Converts RGB to CMYKA (with alpha) using custom ICC profiles.

Parameters:

ParameterTypeDescription
pixelsintThe RGB colors presented as 32-bit integer values.
start_indexintThe start index of RGB color.
lengthintThe number of RGB pixels to convert.
rgb_icc_stream_io.BufferedRandomThe RGB profile stream.
cmyk_icc_stream_io.BufferedRandomThe CMYK profile stream.

Returns

TypeDescription
byteThe CMYK colors presented as a byte array.

Method: to_psd_cmyk_icc(argb) [static]

 to_psd_cmyk_icc(argb) 

The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Parameters:

ParameterTypeDescription
argbintThe ARGB color.

Returns

TypeDescription
intThe CMYK color presented as a 32-bit integer value in KCMY byte order with inverted channel values.

Method: to_psd_cmyk_icc(pixel, rgb_icc_stream, cmyk_icc_stream) [static]

 to_psd_cmyk_icc(pixel, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Parameters:

ParameterTypeDescription
pixelint
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

Method: to_psd_cmyk_icc(pixels) [static]

 to_psd_cmyk_icc(pixels) 

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

Method: to_psd_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream) [static]

 to_psd_cmyk_icc(pixels, rgb_icc_stream, cmyk_icc_stream) 

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
Uses PSD CMYK format KCMY byte order with inverted channel values.

Parameters:

ParameterTypeDescription
pixelsintThe ARGB colors.
rgb_icc_stream_io.BufferedRandomThe stream containing RGB Icc profile.
cmyk_icc_stream_io.BufferedRandomThe stream containing CMYK Icc profile.

Returns

TypeDescription
intThe CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

Examples

The following example fills the central area of a raster image with black pixels using the aspose.imaging.RasterImage.save_cmyk_32_pixels method.

from aspose.pycore import as_of
from aspose.imaging import Image, RasterImage, Rectangle, Color, CmykColorHelper
from os.path import join as join_path

directory = r"c:\temp"

with Image.load(join_path(directory, "sample.png")) as image:
	rasterImage = as_of(image, RasterImage)
	# Get an integer representation of black in the CMYK color space.
	blackCmyk = CmykColorHelper.to_cmyk(Color.black)
	# The black square.
	pixel_count = (rasterImage.width // 2) * (rasterImage.height // 2)
	pixels = [blackCmyk] * pixel_count
	# Draw the black square at the center of the image.
	area = Rectangle(rasterImage.width // 4, rasterImage.height // 4, rasterImage.width // 2, rasterImage.height // 2)
	rasterImage.save_cmyk_32_pixels(area, pixels)

	rasterImage.save(join_path(directory, "sample.SaveCmyk32Pixels.png"))

The following example shows how to convert RGB colors to their CMYK counterparts without applying ICC profiles.


from aspose.imaging import Color, CmykColorHelper

rgbColors = [Color.red, Color.green, Color.blue]

print("Convert RGB to CMYK without using ICC profiles.")
for rgbColor in rgbColors:
	cmyk = CmykColorHelper.to_cmyk(rgbColor)
	c = CmykColorHelper.get_c(cmyk)
	m = CmykColorHelper.get_m(cmyk)
	y = CmykColorHelper.get_y(cmyk)
	k = CmykColorHelper.get_k(cmyk)
	print(f"RGB({rgbColor.r},{rgbColor.g},{rgbColor.b})\t\t=> CMYK({c},{m},{y},{k})")

# The output looks like this:
# Convert RGB to CMYK without using ICC profiles.
# RGB(255,0,0)		=> CMYK(0,255,255,0)
# RGB(0,128,0)		=> CMYK(255,0,255,127)
# RGB(0,0,255)		=> CMYK(255,255,0,0)