Gimp.ColorProfile

g GObject.Object GObject.Object Gimp.ColorProfile Gimp.ColorProfile GObject.Object->Gimp.ColorProfile

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_lcms_format (format)

class

new_d50_gray_lab_trc ()

class

new_d65_gray_linear ()

class

new_d65_gray_srgb_trc ()

class

new_from_file (file)

class

new_from_icc_profile (data)

class

new_from_lcms_profile (lcms_profile)

class

new_rgb_adobe ()

class

new_rgb_srgb ()

class

new_rgb_srgb_linear ()

get_copyright ()

get_description ()

get_format (format, intent)

get_icc_profile ()

get_label ()

get_lcms_profile ()

get_manufacturer ()

get_model ()

get_space (intent)

get_summary ()

is_cmyk ()

is_equal (profile2)

is_gray ()

is_linear ()

is_rgb ()

new_linear_from_color_profile ()

new_srgb_trc_from_color_profile ()

save_to_file (file)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gimp.ColorProfile(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gimp.ColorProfileClass

Definitions and Functions relating to LCMS.

classmethod get_lcms_format(format)
Parameters:

format (Babl.Object) – a Babl.Object format

Returns:

the Babl.Object format to be used instead of format, or None if the passed format is not supported at all.

lcms_format:

return location for an lcms format

Return type:

(Babl.Object or None, lcms_format: int)

This function takes a Babl.Object format and returns the lcms format to be used with that format. It also returns a Babl.Object format to be used instead of the passed format, which usually is the same as format, unless lcms doesn’t support format.

Note that this function currently only supports RGB, RGBA, R’G’B’, R’G’B’A, Y, YA, Y’, Y’A and the cairo-RGB24 and cairo-ARGB32 formats.

New in version 2.10.

classmethod new_d50_gray_lab_trc()
Returns:

a gray profile with the D50 ICC profile illuminant as the profile white point and the LAB companding curve as the TRC. as the TRC.

Return type:

Gimp.ColorProfile

This function creates a grayscale Gimp.ColorProfile with the D50 ICC profile illuminant as the profile white point and the LAB companding curve as the TRC.

New in version 2.10.

classmethod new_d65_gray_linear()
Return type:

Gimp.ColorProfile

classmethod new_d65_gray_srgb_trc()
Returns:

the sRGB-gamma grayscale Gimp.ColorProfile.

Return type:

Gimp.ColorProfile

This function creates a grayscale Gimp.ColorProfile with an sRGB TRC. See Gimp.ColorProfile.new_rgb_srgb().

New in version 2.10.

classmethod new_from_file(file)
Parameters:

file (Gio.File) – a Gio.File

Raises:

GLib.Error

Returns:

the Gimp.ColorProfile, or None. On error, None is returned and error is set.

Return type:

Gimp.ColorProfile or None

This function opens an ICC color profile from file.

New in version 2.10.

classmethod new_from_icc_profile(data)
Parameters:

data (bytes) – The memory containing an ICC profile

Raises:

GLib.Error

Returns:

the Gimp.ColorProfile, or None.

Return type:

Gimp.ColorProfile or None

This function opens an ICC color profile from memory. On error, None is returned and error is set.

New in version 2.10.

classmethod new_from_lcms_profile(lcms_profile)
Parameters:

lcms_profile (object or None) – an LCMS cmsHPROFILE pointer

Raises:

GLib.Error

Returns:

the Gimp.ColorProfile, or None.

Return type:

Gimp.ColorProfile or None

This function creates a Gimp.ColorProfile from a cmsHPROFILE. On error, None is returned and error is set. The passed lcms_profile pointer is not retained by the created Gimp.ColorProfile.

New in version 2.10.

classmethod new_rgb_adobe()
Returns:

the AdobeRGB-compatible Gimp.ColorProfile.

Return type:

Gimp.ColorProfile

This function creates a profile compatible with AbobeRGB (1998).

New in version 2.10.

classmethod new_rgb_srgb()
Returns:

the sRGB Gimp.ColorProfile.

Return type:

Gimp.ColorProfile

This function is a replacement for cmsCreate_sRGBProfile() and returns an sRGB profile that is functionally the same as the ArgyllCMS sRGB.icm profile. “Functionally the same” means it has the same red, green, and blue colorants and the V4 “chad” equivalent of the ArgyllCMS V2 white point. The profile TRC is also functionally equivalent to the ArgyllCMS sRGB.icm TRC and is the same as the LCMS sRGB built-in profile TRC.

The actual primaries in the sRGB specification are red xy: {0.6400, 0.3300, 1.0} green xy: {0.3000, 0.6000, 1.0} blue xy: {0.1500, 0.0600, 1.0}

The sRGB primaries given below are “pre-quantized” to compensate for hexadecimal quantization during the profile-making process. Unless the profile-making code compensates for this quantization, the resulting profile’s red, green, and blue colorants will deviate slightly from the correct XYZ values.

LCMS2 doesn’t compensate for hexadecimal quantization. The “pre-quantized” primaries below were back-calculated from the ArgyllCMS sRGB.icm profile. The resulting sRGB profile’s colorants exactly matches the ArgyllCMS sRGB.icm profile colorants.

New in version 2.10.

classmethod new_rgb_srgb_linear()
Returns:

the linear RGB Gimp.ColorProfile.

Return type:

Gimp.ColorProfile

This function creates a profile for Babl.model(“RGB”). Please somebody write something smarter here.

New in version 2.10.

Returns:

a string containing self's copyright. The returned value belongs to self and must not be modified or freed.

Return type:

str

New in version 2.10.

get_description()
Returns:

a string containing self's description. The returned value belongs to self and must not be modified or freed.

Return type:

str

New in version 2.10.

get_format(format, intent)
Parameters:
Raises:

GLib.Error

Returns:

the new Babl.Object format.

Return type:

Babl.Object

This function takes a Gimp.ColorProfile and a Babl.Object format and returns a new Babl.Object format with self's RGB primaries and TRC, and format's pixel layout.

New in version 2.10.

get_icc_profile()
Returns:

a pointer to the IIC profile data.

Return type:

bytes

This function returns self as ICC profile data. The returned memory belongs to self and must not be modified or freed.

New in version 2.10.

get_label()
Returns:

the self's label. The returned value belongs to self and must not be modified or freed.

Return type:

str

This function returns a string containing self's “title”, a string that can be used to label the profile in a user interface.

Unlike Gimp.ColorProfile.get_description(), this function always returns a string (as a fallback, it returns “(unnamed profile)”).

New in version 2.10.

get_lcms_profile()
Returns:

a pointer to the cmsHPROFILE.

Return type:

object or None

This function returns self's cmsHPROFILE. The returned value belongs to self and must not be modified or freed.

New in version 2.10.

get_manufacturer()
Returns:

a string containing self's manufacturer. The returned value belongs to self and must not be modified or freed.

Return type:

str

New in version 2.10.

get_model()
Returns:

a string containing self's model. The returned value belongs to self and must not be modified or freed.

Return type:

str

New in version 2.10.

get_space(intent)
Parameters:

intent (Gimp.ColorRenderingIntent) – a Gimp.ColorRenderingIntent

Raises:

GLib.Error

Returns:

the new Babl.Object space.

Return type:

Babl.Object

This function returns the Babl.Object space of self, for the specified intent.

New in version 2.10.6.

get_summary()
Returns:

the self's summary. The returned value belongs to self and must not be modified or freed.

Return type:

str

This function return a string containing a multi-line summary of self's description, model, manufacturer and copyright, to be used as detailed information about the profile in a user interface.

New in version 2.10.

is_cmyk()
Returns:

True if the profile’s color space is CMYK, False otherwise.

Return type:

bool

New in version 2.10.

is_equal(profile2)
Parameters:

profile2 (Gimp.ColorProfile) – a Gimp.ColorProfile

Returns:

True if the profiles are equal, False otherwise.

Return type:

bool

Compares two profiles.

New in version 2.10.

is_gray()
Returns:

True if the profile’s color space is grayscale, False otherwise.

Return type:

bool

New in version 2.10.

is_linear()
Returns:

True if the profile is a matrix shaping profile with linear TRCs, False otherwise.

Return type:

bool

This function determines is the ICC profile represented by a Gimp.ColorProfile is a linear RGB profile or not, some profiles that are LUTs though linear will also return False;

New in version 2.10.

is_rgb()
Returns:

True if the profile’s color space is RGB, False otherwise.

Return type:

bool

New in version 2.10.

new_linear_from_color_profile()
Returns:

the new Gimp.ColorProfile, or None if self is not an RGB profile or not matrix-based.

Return type:

Gimp.ColorProfile or None

This function creates a new RGB Gimp.ColorProfile with a linear TRC and self's RGB chromacities and whitepoint.

New in version 2.10.

new_srgb_trc_from_color_profile()
Returns:

the new Gimp.ColorProfile, or None if self is not an RGB profile or not matrix-based.

Return type:

Gimp.ColorProfile or None

This function creates a new RGB Gimp.ColorProfile with a sRGB gamma TRC and self's RGB chromacities and whitepoint.

New in version 2.10.

save_to_file(file)
Parameters:

file (Gio.File) – a Gio.File

Raises:

GLib.Error

Returns:

True on success, False if an error occurred.

Return type:

bool

This function saves self to file as ICC profile.

New in version 2.10.