Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Gimp.adaptive_supersample_area(x1, y1, x2, y2, max_depth, threshold, render_func, render_data, put_pixel_func, put_pixel_data, progress_func, *progress_data)¶
- Parameters:
x1 (
int
) – left x coordinate of the area to process.y1 (
int
) – top y coordinate of the area to process.x2 (
int
) – right x coordinate of the area to process.y2 (
int
) – bottom y coordinate of the area to process.max_depth (
int
) – maximum depth of supersampling.threshold (
float
) – lower threshold of pixel difference that stops supersampling.render_func (
Gimp.RenderFunc
) – function calculate the color value at given coordinates.render_data (
object
orNone
) – user data passed to render_func.put_pixel_func (
Gimp.PutPixelFunc
) – function to a pixels to a color at given coordinates.put_pixel_data (
object
orNone
) – user data passed to put_pixel_func.progress_func (
Gimp.ProgressFunc
) – function to report progress.progress_data (
object
orNone
) – user data passed to progress_func.
- Returns:
the number of pixels processed.
- Return type:
- Gimp.airbrush(drawable, pressure, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.pressure (
float
) – The pressure of the airbrush strokes.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Paint in the current brush with varying pressure. Paint application is time-dependent.
This tool simulates the use of an airbrush. Paint pressure represents the relative intensity of the paint application. High pressure results in a thicker layer of paint while low pressure results in a thinner layer.
- Gimp.airbrush_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Paint in the current brush with varying pressure. Paint application is time-dependent.
This tool simulates the use of an airbrush. It is similar to
Gimp.airbrush
() except that the pressure is derived from the airbrush tools options box. It the option has not been set the default for the option will be used.
- Gimp.attach_parasite(parasite)¶
- Parameters:
parasite (
Gimp.Parasite
) – The parasite to attach.- Returns:
True
on success.- Return type:
Add a global parasite.
This procedure attaches a global parasite. It has no return values.
New in version 2.8.
- Gimp.babl_format_get_type()¶
- Return type:
- Gimp.bilinear(x, y, values)¶
- Gimp.bilinear_16(x, y, values)¶
- Gimp.bilinear_32(x, y, values)¶
- Gimp.bilinear_8(x, y, values)¶
- Gimp.bilinear_rgb(x, y, values, has_alpha, retvalues)¶
- Gimp.bind_text_domain(domain_name, dir_name)¶
- Parameters:
This function wraps bindtextdomain on UNIX and wbintextdomain on Windows. dir_name is expected to be in the encoding used by the C library on UNIX and UTF-8 on Windows.
New in version 3.0.
- Gimp.brushes_close_popup(brush_callback)¶
- Parameters:
brush_callback (
str
) – The name of the callback registered for this pop-up.- Returns:
True
on success.- Return type:
Close the brush selection dialog.
Closes an open brush selection dialog.
- Gimp.brushes_get_list(filter)¶
- Parameters:
filter (
str
) – An optional regular expression used to filter the list.- Returns:
The list of brushes. The returned value must be freed with
GLib.free
().- Return type:
Retrieve a complete listing of the available brushes.
This procedure returns a complete listing of available GIMP brushes. Each brush returned can be used as input to [func`Gimp`.context_set_brush].
- Gimp.brushes_popup(brush_callback, popup_title, initial_brush, parent_window)¶
- Parameters:
brush_callback (
str
) – The callback PDB proc to call when user chooses a brush.popup_title (
str
) – Title of the brush selection dialog.initial_brush (
Gimp.Brush
orNone
) – The brush to set as the initial choice.parent_window (
GLib.Bytes
orNone
) – An optional parent window handle for the popup to be set transient to.
- Returns:
True
on success.- Return type:
Invokes the GIMP brush selection dialog.
Opens a dialog letting a user choose a brush.
- Gimp.brushes_refresh()¶
-
Refresh current brushes. This function always succeeds.
This procedure retrieves all brushes currently in the user’s brush path and updates the brush dialogs accordingly.
- Gimp.brushes_set_popup(brush_callback, brush)¶
- Parameters:
brush_callback (
str
) – The name of the callback registered for this pop-up.brush (
Gimp.Brush
) – The brush to set as selected.
- Returns:
True
on success.- Return type:
Sets the selected brush in a brush selection dialog.
Sets the selected brush in a brush selection dialog.
- Gimp.buffer_delete(buffer_name)¶
-
Deletes a named buffer.
This procedure deletes a named buffer.
New in version 2.4.
- Gimp.buffer_get_bytes(buffer_name)¶
-
Retrieves the specified buffer’s bytes.
This procedure retrieves the specified named buffer’s bytes.
New in version 2.4.
- Gimp.buffer_get_height(buffer_name)¶
-
Retrieves the specified buffer’s height.
This procedure retrieves the specified named buffer’s height.
New in version 2.4.
- Gimp.buffer_get_image_type(buffer_name)¶
- Parameters:
buffer_name (
str
) – The buffer name.- Returns:
The buffer image type.
- Return type:
Retrieves the specified buffer’s image type.
This procedure retrieves the specified named buffer’s image type.
New in version 2.4.
- Gimp.buffer_get_width(buffer_name)¶
-
Retrieves the specified buffer’s width.
This procedure retrieves the specified named buffer’s width.
New in version 2.4.
- Gimp.buffer_rename(buffer_name, new_name)¶
- Parameters:
- Returns:
The real name given to the buffer. The returned value must be freed with
GLib.free
().- Return type:
Renames a named buffer.
This procedure renames a named buffer.
New in version 2.4.
- Gimp.buffers_get_name_list(filter)¶
- Parameters:
filter (
str
orNone
) – An optional regular expression used to filter the list.- Returns:
The list of buffer names. The returned value must be freed with
GLib.strfreev
().- Return type:
[
str
]
Retrieve a complete listing of the available buffers.
This procedure returns a complete listing of available named buffers.
New in version 2.4.
- Gimp.cache_directory()¶
- Returns:
The default top directory for GIMP cached files.
- Return type:
Returns the default top directory for GIMP cached files. If the environment variable GIMP3_CACHEDIR exists, that is used. It should be an absolute pathname. Otherwise, a subdirectory of the directory returned by
GLib.get_user_cache_dir
() is used.Note that the actual directories used for GIMP caches files can be overridden by the user in the preferences dialog.
In config files such as gimprc, the string ${gimp_cache_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn’t necessarily UTF-8. (On Windows it always is UTF-8.).
New in version 2.10.10.
- Gimp.cairo_checkerboard_create(cr, size, light, dark)¶
- Parameters:
cr (
cairo.Context
) – Cairo contextsize (
int
) – check sizelight (
Gegl.Color
) – light check color orNone
to use the default light graydark (
Gegl.Color
) – dark check color orNone
to use the default dark gray
- Returns:
a new Cairo pattern that can be used as a source on cr.
- Return type:
Create a repeating checkerboard pattern.
New in version 2.6.
- Gimp.cairo_surface_create_buffer(surface, format)¶
- Parameters:
surface (
cairo.Surface
) – a Cairo surfaceformat (
Babl.Object
) – aBabl.Object
format.
- Returns:
- Return type:
This function returns a
Gegl.Buffer
which wraps surface's pixels. It must only be called on image surfaces, calling it on other surface types is an error.If format is set, the returned [class`Gegl`.Buffer] will use it. It has to map with surface Cairo format. If unset, the buffer format will be determined from surface. The main difference is that automatically determined format has sRGB space and TRC by default.
New in version 2.10.
- Gimp.cairo_surface_get_format(surface)¶
- Parameters:
surface (
cairo.Surface
) – a Cairo surface- Returns:
the
Babl.Object
format of surface.- Return type:
This function returns a
Babl.Object
format that corresponds to surface's pixel format.New in version 2.10.
- Gimp.canonicalize_identifier(identifier)¶
- Parameters:
identifier (
str
) – The identifier string to canonicalize.- Returns:
The canonicalized identifier. This is a newly allocated string that should be freed with
GLib.free
() when no longer needed.- Return type:
Turns any input string into a canonicalized string.
Canonical identifiers are e.g. expected by the PDB for procedure and parameter names. Every character of the input string that is not either ‘-’, ‘a-z’, ‘A-Z’ or ‘0-9’ will be replaced by a ‘-‘.
New in version 2.4.
- Gimp.check_custom_color1()¶
- Returns:
the _check_custom_color1 value
- Return type:
Returns the first checkerboard custom color that can be used in previews.
This is a constant value given at plug-in configuration time.
New in version 3.0.
- Gimp.check_custom_color2()¶
- Returns:
the _check_custom_color2 value
- Return type:
Returns the second checkerboard custom color that can be used in previews.
This is a constant value given at plug-in configuration time.
New in version 3.0.
- Gimp.check_size()¶
- Returns:
the check_size value
- Return type:
Returns the size of the checkerboard to be used in previews.
This is a constant value given at plug-in configuration time.
New in version 2.2.
- Gimp.check_type()¶
- Returns:
the check_type value
- Return type:
Returns the type of the checkerboard to be used in previews.
This is a constant value given at plug-in configuration time.
New in version 2.2.
- Gimp.checks_get_colors(type, color1, color2)¶
- Parameters:
type (
Gimp.CheckType
) – the checkerboard typecolor1 (
Gegl.Color
) – current custom color and return location for the first color.color2 (
Gegl.Color
) – current custom color and return location for the second color.
- Returns:
- color1:
current custom color and return location for the first color.
- color2:
current custom color and return location for the second color.
- Return type:
(color1:
Gegl.Color
, color2:Gegl.Color
)
Retrieves the colors to use when drawing a checkerboard for a certain
Gimp.CheckType
and custom colors. If type isGimp.CheckType.CUSTOM_CHECKS
, then color1 and color2 will remain untouched, which means you must initialize them to the values expected for custom checks.To obtain the user-set colors in Preferences, just call:
GeglColor *color1 = gimp_check_custom_color1 (); GeglColor *color2 = gimp_check_custom_color2 (); gimp_checks_get_colors (gimp_check_type (), &color1, &color2);
New in version 3.0.
- Gimp.clone(drawable, src_drawable, clone_type, src_x, src_y, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.src_drawable (
Gimp.Drawable
) – The source drawable.clone_type (
Gimp.CloneType
) – The type of clone.src_x (
float
) – The x coordinate in the source image.src_y (
float
) – The y coordinate in the source image.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Clone from the source to the dest drawable using the current brush
This tool clones (copies) from the source drawable starting at the specified source coordinates to the dest drawable. If the \”clone_type\” argument is set to PATTERN-CLONE, then the current pattern is used as the source and the \”src_drawable\” argument is ignored. Pattern cloning assumes a tileable pattern and mods the sum of the src coordinates and subsequent stroke offsets with the width and height of the pattern. For image cloning, if the sum of the src coordinates and subsequent stroke offsets exceeds the extents of the src drawable, then no paint is transferred. The clone tool is capable of transforming between any image types including RGB->Indexed–although converting from any type to indexed is significantly slower.
- Gimp.clone_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Clone from the source to the dest drawable using the current brush
This tool clones (copies) from the source drawable starting at the specified source coordinates to the dest drawable. This function performs exactly the same as the
Gimp.clone
() function except that the tools arguments are obtained from the clones option dialog. It this dialog has not been activated then the dialogs default values will be used.
- Gimp.color_array_copy(array)¶
- Parameters:
array (
Gegl.Color
) – an array of colors.- Returns:
a new #GimpColorArray.
- Return type:
Creates a new #GimpColorArray containing a deep copy of a
None
-terminated array of [class`Gegl`.Color].
- Gimp.color_array_free(array)¶
- Parameters:
array (
Gegl.Color
) – an array of colors.
Frees a
None
-terminated array of [class`Gegl`.Color].
- Gimp.color_array_get_length(array)¶
- Parameters:
array (
Gegl.Color
) – an array of colors.- Returns:
the number of [class`Gegl`.Color] in array.
- Return type:
- Gimp.color_array_get_type()¶
- Return type:
- Gimp.color_is_out_of_gamut(color, space)¶
- Parameters:
color (
Gegl.Color
) – a [class`Gegl`.Color]space (
Babl.Object
) – a color space to convert color to.
- Returns:
whether the color is out of space gamut.
- Return type:
Determine whether color is out of its space gamut. A small error of margin is accepted, so that for instance a component at -0.0000001 is not making the whole color to be considered as out-of-gamut while it may just be computation imprecision.
New in version 3.0.
- Gimp.color_is_out_of_self_gamut(color)¶
- Parameters:
color (
Gegl.Color
) – a [class`Gegl`.Color]- Returns:
whether the color is out of its own color space gamut.
- Return type:
Determine whether color is out of its own space gamut. This can only happen if the color space is unbounded and any of the color component is out of the
[0; 1]
range. A small error of margin is accepted, so that for instance a component at -0.0000001 is not making the whole color to be considered as out-of-gamut while it may just be computation imprecision.New in version 3.0.
- Gimp.color_is_perceptually_identical(color1, color2)¶
- Parameters:
color1 (
Gegl.Color
) – a [class`Gegl`.Color]color2 (
Gegl.Color
) – a [class`Gegl`.Color]
- Returns:
whether the 2 colors can be considered the same for the human eyes.
- Return type:
Determine whether color1 and color2 can be considered identical to the human eyes, by computing the distance in a color space as perceptually uniform as possible.
This function will also consider any transparency channel, so that if you only want to compare the pure color, you could for instance set both color’s alpha channel to 1.0 first (possibly on duplicates of the colors if originals should not be modified), such as:
``C gimp_color_set_alpha (color1, 1.0); gimp_color_set_alpha (color2, 1.0); if (gimp_color_is_perceptually_identical (color1, color2))
- {
printf (“Both colors are identical, ignoring their alpha component”);
}
New in version 3.0.
- Gimp.color_list_names()¶
- Returns:
an array of color names.
- colors:
return location for an array of [class`Gegl`.Color]
- Return type:
([
str
], colors: [Gegl.Color
])
Returns the list of SVG 1.0 color keywords that is recognized by [func`color_parse_name`].
The returned strings are const and must not be freed. Only the array must be freed with
g_free()
.The optional colors arrays must be freed with [func`color_array_free`] when they are no longer needed.
New in version 2.2.
- Gimp.color_parse_css(css)¶
- Parameters:
css (
str
) – a string describing a color in CSS notation- Returns:
a newly allocated [class`Gegl`.Color] if css was parsed successfully,
None
otherwise- Return type:
Attempts to parse a string describing an sRGB color in CSS notation. This can be either a numerical representation (
rgb(255,0,0)
orrgb(100%,0%,0%)
) or a hexadecimal notation as parsed by [func`color_parse_hex`] (##ff0000
) or a color name as parsed by [func`color_parse_css`] (red
).Additionally the
rgba()
,hsl()
andhsla()
functions are supported too.
- Gimp.color_parse_hex(hex)¶
- Parameters:
hex (
str
) – a string describing a color in hexadecimal notation- Returns:
a newly allocated color representing hex.
- Return type:
Attempts to parse a string describing a sRGB color in hexadecimal notation (optionally prefixed with a ‘#’).
- Gimp.color_parse_name(name)¶
- Parameters:
name (
str
) – a color name (in UTF-8 encoding)- Returns:
a sRGB color as defined in “4.4. Recognized color keyword names” list of SVG 1.1 specification, if name was parsed successfully,
None
otherwise- Return type:
Attempts to parse a color name. This function accepts SVG 1.1 color keywords.
- Gimp.color_set_alpha(color, alpha)¶
- Parameters:
color (
Gegl.Color
) – a [class`Gegl`.Color]alpha (
float
) – new value for the alpha channel.
Update the alpha channel, and any other component if necessary (e.g. in case of premultiplied channels), without changing the format of color.
If color has no alpha component, this function is a no-op.
New in version 3.0.
- Gimp.config_build_data_path(name)¶
- Parameters:
name (
str
) – directory name (in UTF-8 encoding)- Returns:
a newly allocated string
- Return type:
Creates a search path as it is used in the gimprc file. The path returned by
Gimp.ConfigInterface.build_data_path
() includes a directory below the user’s gimp directory and one in the system-wide data directory.Note that you cannot use this path directly with
Gimp.Path.parse
(). As it is in the gimprc notation, you first need to expand and recode it usingGimp.ConfigPath.expand
().New in version 2.4.
- Gimp.config_build_plug_in_path(name)¶
- Parameters:
name (
str
) – directory name (in UTF-8 encoding)- Returns:
a newly allocated string
- Return type:
Creates a search path as it is used in the gimprc file. The path returned by
Gimp.ConfigInterface.build_plug_in_path
() includes a directory below the user’s gimp directory and one in the system-wide plug-in directory.Note that you cannot use this path directly with
Gimp.Path.parse
(). As it is in the gimprc notation, you first need to expand and recode it usingGimp.ConfigPath.expand
().New in version 2.4.
- Gimp.config_build_system_path(name)¶
- Parameters:
name (
str
) – directory name (in UTF-8 encoding)- Returns:
a newly allocated string
- Return type:
Creates a search path as it is used in the gimprc file. The path returned by
Gimp.ConfigInterface.build_system_path
() is just the read-only parts of the search path constructed byGimp.ConfigInterface.build_plug_in_path
().Note that you cannot use this path directly with
Gimp.Path.parse
(). As it is in the gimprc notation, you first need to expand and recode it usingGimp.ConfigPath.expand
().New in version 2.10.6.
- Gimp.config_build_writable_path(name)¶
- Parameters:
name (
str
) – directory name (in UTF-8 encoding)- Returns:
a newly allocated string
- Return type:
Creates a search path as it is used in the gimprc file. The path returned by
Gimp.ConfigInterface.build_writable_path
() is just the writable parts of the search path constructed byGimp.ConfigInterface.build_data_path
().Note that you cannot use this path directly with
Gimp.Path.parse
(). As it is in the gimprc notation, you first need to expand and recode it usingGimp.ConfigPath.expand
().New in version 2.4.
- Gimp.config_deserialize_return(scanner, expected_token, nest_level)¶
- Parameters:
scanner (
GLib.Scanner
) – aGLib.Scanner
expected_token (
GLib.TokenType
) – the expected tokennest_level (
int
) – the nest level
- Return type:
New in version 2.4.
- Gimp.config_diff(a, b, flags)¶
- Parameters:
a (
GObject.Object
) – aGObject.Object
b (
GObject.Object
) – anotherGObject.Object
objectflags (
GObject.ParamFlags
) – a mask ofGObject.ParamFlags
- Returns:
a
GLib.List
of differing GParamSpecs.- Return type:
Compares all properties of a and b that have all flags set. If flags is 0, all properties are compared.
If the two objects are not of the same type, only properties that exist in both object classes and are of the same value_type are compared.
New in version 2.4.
- Gimp.config_error_quark()¶
- Returns:
the #GQuark that defines the
Gimp.Config
error domain.- Return type:
This function is never called directly. Use GIMP_CONFIG_ERROR() instead.
New in version 2.4.
- Gimp.config_param_spec_duplicate(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – theGObject.ParamSpec
to duplicate- Returns:
The new
GObject.ParamSpec
, orNone
.- Return type:
Creates an exact copy of pspec, with all its properties, returns
None
if pspec is of an unknown type that can’t be duplicated.New in version 3.0.
- Gimp.config_reset_properties(object)¶
- Parameters:
object (
GObject.Object
) – aGObject.Object
Resets all writable properties of object to the default values as defined in their
GObject.ParamSpec
. Properties marked as “construct-only” are not touched.If you want to reset a
Gimp.Config
object, please useGimp.Config.reset
().New in version 2.4.
- Gimp.config_reset_property(object, property_name)¶
- Parameters:
object (
GObject.Object
) – aGObject.Object
property_name (
str
) – name of the property to reset
Resets the property named property_name to its default value. The property must be writable and must not be marked as “construct-only”.
New in version 2.4.
- Gimp.config_serialize_value(value, str, escaped)¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
.str (
GLib.String
) – aGLib.String
.escaped (
bool
) – whether to escape string values.
- Returns:
- Return type:
This utility function appends a string representation of
GObject.Value
to str.New in version 2.4.
- Gimp.config_string_append_escaped(string, val)¶
- Parameters:
string (
GLib.String
) – pointer to aGLib.String
Escapes and quotes val and appends it to string. The escape algorithm is different from the one used by
GLib.strescape
() since it leaves non-ASCII characters intact and thus preserves UTF-8 strings. Only control characters and quotes are being escaped.New in version 2.4.
- Gimp.config_sync(src, dest, flags)¶
- Parameters:
src (
GObject.Object
) – aGObject.Object
dest (
GObject.Object
) – anotherGObject.Object
flags (
GObject.ParamFlags
) – a mask ofGObject.ParamFlags
- Returns:
- Return type:
Compares all read- and write-able properties from src and dest that have all flags set. Differing values are then copied from src to dest. If flags is 0, all differing read/write properties.
Properties marked as “construct-only” are not touched.
If the two objects are not of the same type, only properties that exist in both object classes and are of the same value_type are synchronized
New in version 2.4.
- Gimp.config_type_register(parent_type, type_name, pspecs)¶
- Parameters:
parent_type (
GObject.GType
) – type from which this type will be derivedtype_name (
str
) – string used as the name of the new typepspecs ([
GObject.ParamSpec
]) – array ofGObject.ParamSpec
to install as properties on the new type
- Returns:
the newly registered
GObject.GType
- Return type:
This function is a fancy wrapper around
GObject.type_register_static
(). It creates a new object type as subclass of parent_type, installs pspecs on it and makes the new type implement theGimp.Config
interface.New in version 3.0.
- Gimp.context_are_dynamics_enabled()¶
- Returns:
Whether dynamics enabled or disabled.
- Return type:
Whether the currently active paint dynamics will be applied to painting.
Returns whether the currently active paint dynamics (as returned by gimp_context_get_dynamics()) is enabled.
New in version 3.0.
- Gimp.context_enable_dynamics(enable)¶
- Parameters:
enable (
bool
) – Whether to enable or disable dynamics.- Returns:
True
on success.- Return type:
Enables paint dynamics using the active paint dynamics.
Enables the active paint dynamics to be used in all subsequent paint operations.
New in version 3.0.
- Gimp.context_get_antialias()¶
- Returns:
The antialias setting.
- Return type:
Get the antialias setting.
Returns the antialias setting.
New in version 2.8.
- Gimp.context_get_background()¶
- Returns:
The background color.
- Return type:
Get the current GIMP background color.
Returns the current GIMP background color. The background color is used in a variety of tools such as blending, erasing (with non-alpha images), and image filling.
New in version 2.2.
- Gimp.context_get_brush()¶
- Returns:
The active brush.
- Return type:
Get the currently active brush.
Returns the currently active brush. All paint and stroke operations use this brush.
New in version 2.2.
- Gimp.context_get_brush_angle()¶
- Returns:
Angle in degrees.
- Return type:
Get brush angle in degrees.
Set the angle in degrees for brush based paint tools.
New in version 2.8.
- Gimp.context_get_brush_aspect_ratio()¶
- Returns:
Aspect ratio.
- Return type:
Get brush aspect ratio.
Set the aspect ratio for brush based paint tools.
New in version 2.8.
- Gimp.context_get_brush_force()¶
- Returns:
Brush application force.
- Return type:
Get brush force in paint options.
Get the brush application force for brush based paint tools.
New in version 2.10.
- Gimp.context_get_brush_hardness()¶
- Returns:
Brush hardness.
- Return type:
Get brush hardness in paint options.
Get the brush hardness for brush based paint tools.
New in version 2.10.
- Gimp.context_get_brush_size()¶
- Returns:
Brush size in pixels.
- Return type:
Get brush size in pixels.
Get the brush size in pixels for brush based paint tools.
New in version 2.8.
- Gimp.context_get_brush_spacing()¶
- Returns:
Brush spacing as fraction of size.
- Return type:
Get brush spacing as percent of size.
Get the brush spacing as percent of size for brush based paint tools.
New in version 2.10.
- Gimp.context_get_diagonal_neighbors()¶
- Returns:
The diagonal neighbors setting.
- Return type:
Get the diagonal neighbors setting.
Returns the diagonal neighbors setting.
New in version 2.10.
- Gimp.context_get_distance_metric()¶
- Returns:
The distance metric.
- Return type:
Get the distance metric used in some computations.
Returns the distance metric in the current context. See
Gimp.context_set_distance_metric
() to know more about its usage.New in version 2.10.
- Gimp.context_get_dynamics_name()¶
- Returns:
The name of the active paint dynamics. The returned value must be freed with
GLib.free
().- Return type:
Get the currently active paint dynamics.
Returns the name of the currently active paint dynamics. If enabled, all paint operations and stroke operations use this paint dynamics to control the application of paint to the image. If disabled, the dynamics will be ignored during paint actions. See
Gimp.context_are_dynamics_enabled
() to enquire whether dynamics are used or ignored.New in version 2.8.
- Gimp.context_get_emulate_brush_dynamics()¶
- Returns:
The emulate brush dynamics setting.
- Return type:
Retrieve the currently active stroke option’s emulate brush dynamics setting.
This procedure returns the emulate brush dynamics property of the currently active stroke options.
New in version 3.0.
- Gimp.context_get_feather()¶
- Returns:
The feather setting.
- Return type:
Get the feather setting.
Returns the feather setting.
New in version 2.8.
- Gimp.context_get_feather_radius()¶
- Returns:
True
on success.- feather_radius_x:
The horizontal feather radius.
- feather_radius_y:
The vertical feather radius.
- Return type:
Get the feather radius setting.
Returns the feather radius setting.
New in version 2.8.
- Gimp.context_get_font()¶
- Returns:
The active font.
- Return type:
Get the currently active font.
Returns the currently active font.
New in version 2.2.
- Gimp.context_get_foreground()¶
- Returns:
The foreground color.
- Return type:
Get the current GIMP foreground color.
Returns the current GIMP foreground color. The foreground color is used in a variety of tools such as paint tools, blending, and bucket fill.
New in version 2.2.
- Gimp.context_get_gradient()¶
- Returns:
The active gradient.
- Return type:
Get the currently active gradient.
Returns the currently active gradient.
New in version 2.2.
- Gimp.context_get_gradient_blend_color_space()¶
- Returns:
Color blend space.
- Return type:
Get the gradient blend color space.
Get the gradient blend color space for paint tools and the gradient tool.
New in version 2.10.
- Gimp.context_get_gradient_repeat_mode()¶
- Returns:
Repeat mode.
- Return type:
Get the gradient repeat mode.
Get the gradient repeat mode for paint tools and the gradient tool.
New in version 2.10.
- Gimp.context_get_gradient_reverse()¶
- Returns:
Reverse.
- Return type:
Get the gradient reverse setting.
Get the gradient reverse setting for paint tools and the gradient tool.
New in version 2.10.
- Gimp.context_get_ink_angle()¶
- Returns:
ink angle in degrees.
- Return type:
Get ink angle in degrees.
Get the ink angle in degrees for ink tool.
New in version 2.8.
- Gimp.context_get_ink_blob_angle()¶
- Returns:
ink blob angle in degrees.
- Return type:
Get ink blob angle in degrees.
Get the ink blob angle in degrees for ink tool.
New in version 2.8.
- Gimp.context_get_ink_blob_aspect_ratio()¶
- Returns:
ink blob aspect ratio.
- Return type:
Get ink blob aspect ratio.
Get the ink blob aspect ratio for ink tool.
New in version 2.8.
- Gimp.context_get_ink_blob_type()¶
- Returns:
Ink blob type.
- Return type:
Get ink blob type.
Get the ink blob type for ink tool.
New in version 2.8.
- Gimp.context_get_ink_size()¶
- Returns:
ink blob size in pixels.
- Return type:
Get ink blob size in pixels.
Get the ink blob size in pixels for ink tool.
New in version 2.8.
- Gimp.context_get_ink_size_sensitivity()¶
- Returns:
ink size sensitivity.
- Return type:
Get ink size sensitivity.
Get the ink size sensitivity for ink tool.
New in version 2.8.
- Gimp.context_get_ink_speed_sensitivity()¶
- Returns:
ink speed sensitivity.
- Return type:
Get ink speed sensitivity.
Get the ink speed sensitivity for ink tool.
New in version 2.8.
- Gimp.context_get_ink_tilt_sensitivity()¶
- Returns:
ink tilt sensitivity.
- Return type:
Get ink tilt sensitivity.
Get the ink tilt sensitivity for ink tool.
New in version 2.8.
- Gimp.context_get_interpolation()¶
- Returns:
The interpolation type.
- Return type:
Get the interpolation type.
Returns the interpolation setting. The return value is an integer which corresponds to the values listed in the argument description. If the interpolation has not been set explicitly by
Gimp.context_set_interpolation
(), the default interpolation set in gimprc will be used.New in version 2.8.
- Gimp.context_get_line_cap_style()¶
- Returns:
The line cap style setting.
- Return type:
Get the line cap style setting.
Returns the line cap style setting.
New in version 2.10.
- Gimp.context_get_line_dash_offset()¶
- Returns:
The line dash offset setting.
- Return type:
Get the line dash offset setting.
Returns the line dash offset setting.
New in version 2.10.
- Gimp.context_get_line_dash_pattern()¶
- Returns:
True
on success.- dashes:
The line dash pattern setting.
- Return type:
Get the line dash pattern setting.
Returns the line dash pattern setting.
New in version 2.10.
- Gimp.context_get_line_join_style()¶
- Returns:
The line join style setting.
- Return type:
Get the line join style setting.
Returns the line join style setting.
New in version 2.10.
- Gimp.context_get_line_miter_limit()¶
- Returns:
The line miter limit setting.
- Return type:
Get the line miter limit setting.
Returns the line miter limit setting.
New in version 2.10.
- Gimp.context_get_line_width()¶
- Returns:
The line width setting.
- Return type:
Get the line width setting.
Returns the line width setting.
New in version 2.10.
- Gimp.context_get_line_width_unit()¶
- Returns:
The line width unit setting.
- Return type:
Get the line width unit setting.
Returns the line width unit setting.
New in version 2.10.
- Gimp.context_get_mypaint_brush()¶
- Returns:
The name of the active MyPaint brush. The returned value must be freed with
GLib.free
().- Return type:
Get the currently active MyPaint brush.
Returns the name of the currently active MyPaint brush.
New in version 2.10.
- Gimp.context_get_opacity()¶
- Returns:
The opacity.
- Return type:
Get the opacity.
Returns the opacity setting. The return value is a floating point number between 0 and 100.
New in version 2.2.
- Gimp.context_get_paint_method()¶
- Returns:
The name of the active paint method. The returned value must be freed with
GLib.free
().- Return type:
Get the currently active paint method.
Returns the name of the currently active paint method.
New in version 2.4.
- Gimp.context_get_paint_mode()¶
- Returns:
The paint mode.
- Return type:
Get the paint mode.
Returns the paint-mode setting. The return value is an integer which corresponds to the values listed in the argument description.
New in version 2.2.
- Gimp.context_get_palette()¶
- Returns:
The active palette.
- Return type:
Get the currently active palette.
Returns the currently active palette.
New in version 2.2.
- Gimp.context_get_pattern()¶
- Returns:
The active pattern.
- Return type:
Get the currently active pattern.
Returns the active pattern in the current context. All clone and bucket-fill operations with patterns will use this pattern to control the application of paint to the image.
New in version 2.2.
- Gimp.context_get_sample_criterion()¶
- Returns:
The sample criterion setting.
- Return type:
Get the sample criterion setting.
Returns the sample criterion setting.
New in version 2.8.
- Gimp.context_get_sample_merged()¶
- Returns:
The sample merged setting.
- Return type:
Get the sample merged setting.
Returns the sample merged setting.
New in version 2.8.
- Gimp.context_get_sample_threshold()¶
- Returns:
The sample threshold setting.
- Return type:
Get the sample threshold setting.
Returns the sample threshold setting.
New in version 2.8.
- Gimp.context_get_sample_threshold_int()¶
- Returns:
The sample threshold setting.
- Return type:
Get the sample threshold setting as an integer value.
Returns the sample threshold setting as an integer value. See
Gimp.context_get_sample_threshold
().New in version 2.8.
- Gimp.context_get_sample_transparent()¶
- Returns:
The sample transparent setting.
- Return type:
Get the sample transparent setting.
Returns the sample transparent setting.
New in version 2.8.
- Gimp.context_get_stroke_method()¶
- Returns:
The active stroke method.
- Return type:
Get the currently active stroke method.
Returns the currently active stroke method.
New in version 2.10.
- Gimp.context_get_transform_direction()¶
- Returns:
The transform direction.
- Return type:
Get the transform direction.
Returns the transform direction. The return value is an integer which corresponds to the values listed in the argument description.
New in version 2.8.
- Gimp.context_get_transform_resize()¶
- Returns:
The transform resize type.
- Return type:
Get the transform resize type.
Returns the transform resize setting. The return value is an integer which corresponds to the values listed in the argument description.
New in version 2.8.
- Gimp.context_list_paint_methods()¶
- Returns:
True
on success.- paint_methods:
The names of the available paint methods.
- Return type:
Lists the available paint methods.
Lists the names of the available paint methods. Any of the names can be used for
Gimp.context_set_paint_method
().New in version 2.4.
- Gimp.context_pop()¶
-
Pops the topmost context from the plug-in’s context stack.
Removes the topmost context from the plug-in’s context stack. The next context on the stack becomes the new current context of the plug-in, that is, the context that was active before the corresponding call to
Gimp.context_push
()New in version 2.2.
- Gimp.context_push()¶
-
Pushes a context onto the top of the plug-in’s context stack.
Creates a new context by copying the current context. The copy becomes the new current context for the calling plug-in until it is popped again using
Gimp.context_pop
().New in version 2.2.
- Gimp.context_set_antialias(antialias)¶
-
Set the antialias setting.
Modifies the antialias setting. If antialiasing is turned on, the edges of selected region will contain intermediate values which give the appearance of a sharper, less pixelized edge. This should be set as
True
most of the time unless a binary-only selection is wanted.This setting affects the following procedures:
Gimp.Image.select_color
(),Gimp.Image.select_contiguous_color
(),Gimp.Image.select_round_rectangle
(),Gimp.Image.select_ellipse
(),Gimp.Image.select_polygon
(),Gimp.Image.select_item
(),Gimp.Drawable.edit_bucket_fill
(),Gimp.Drawable.edit_stroke_item
(),Gimp.Drawable.edit_stroke_selection
().New in version 2.8.
- Gimp.context_set_background(background)¶
- Parameters:
background (
Gegl.Color
) – The background color.- Returns:
True
on success.- Return type:
Set the current GIMP background color.
Sets the current GIMP background color. After this is set, operations which use background such as blending, filling images, clearing, and erasing (in non-alpha images) will use the new value.
New in version 2.2.
- Gimp.context_set_brush(brush)¶
- Parameters:
brush (
Gimp.Brush
) – The brush.- Returns:
True
on success.- Return type:
Set the active brush.
Sets the active brush in the current context. The brush will be used in subsequent paint and stroke operations. Returns an error when the brush data was uninstalled since the brush object was created.
New in version 2.2.
- Gimp.context_set_brush_angle(angle)¶
-
Set brush angle in degrees.
Set the angle in degrees for brush based paint tools.
New in version 2.8.
- Gimp.context_set_brush_aspect_ratio(aspect)¶
-
Set brush aspect ratio.
Set the aspect ratio for brush based paint tools.
New in version 2.8.
- Gimp.context_set_brush_default_hardness()¶
-
Set brush spacing to its default.
Set the brush spacing to the default for paintbrush, airbrush, or pencil tools.
New in version 2.10.
- Gimp.context_set_brush_default_size()¶
-
Set brush size to its default.
Set the brush size to the default (max of width and height) for paintbrush, airbrush, or pencil tools.
New in version 2.8.
- Gimp.context_set_brush_default_spacing()¶
-
Set brush spacing to its default.
Set the brush spacing to the default for paintbrush, airbrush, or pencil tools.
New in version 2.10.
- Gimp.context_set_brush_force(force)¶
-
Set brush application force.
Set the brush application force for brush based paint tools.
New in version 2.10.
- Gimp.context_set_brush_hardness(hardness)¶
-
Set brush hardness.
Set the brush hardness for brush based paint tools.
New in version 2.10.
- Gimp.context_set_brush_size(size)¶
-
Set brush size in pixels.
Set the brush size in pixels for brush based paint tools.
New in version 2.8.
- Gimp.context_set_brush_spacing(spacing)¶
- Parameters:
spacing (
float
) – Brush spacing as fraction of size.- Returns:
True
on success.- Return type:
Set brush spacing as percent of size.
Set the brush spacing as percent of size for brush based paint tools.
New in version 2.10.
- Gimp.context_set_default_colors()¶
-
Set the current GIMP foreground and background colors to black and white.
Sets the current GIMP foreground and background colors to their initial default values, black and white.
New in version 2.2.
- Gimp.context_set_defaults()¶
-
Reset context settings to their default values.
Resets context settings used by various procedures to their default value. You should usually call this after a context push so that a script which calls procedures affected by context settings will not be affected by changes in the global context.
New in version 2.8.
- Gimp.context_set_diagonal_neighbors(diagonal_neighbors)¶
- Parameters:
diagonal_neighbors (
bool
) – The diagonal neighbors setting.- Returns:
True
on success.- Return type:
Set the diagonal neighbors setting.
Modifies the diagonal neighbors setting. If the affected region of an operation is based on a seed point, like when doing a seed fill, then, when this setting is
True
, all eight neighbors of each pixel are considered when calculating the affected region; in contrast, when this setting isFalse
, only the four orthogonal neighbors of each pixel are considered.This setting affects the following procedures:
Gimp.Image.select_contiguous_color
(),Gimp.Drawable.edit_bucket_fill
().New in version 2.10.
- Gimp.context_set_distance_metric(metric)¶
- Parameters:
metric (
Gegl.DistanceMetric
) – The distance metric.- Returns:
True
on success.- Return type:
Set the distance metric used in some computations.
Modifies the distance metric used in some computations, such as
Gimp.Drawable.edit_gradient_fill
(). In particular, it does not change the metric used in generic distance computation on canvas, as in the Measure tool.This setting affects the following procedures:
Gimp.Drawable.edit_gradient_fill
().New in version 2.10.
- Gimp.context_set_dynamics_name(name)¶
-
Set the active paint dynamics.
Sets the active paint dynamics. The paint dynamics will be used in all subsequent paint operations when dynamics are enabled. The name should be a name of an installed paint dynamics. Returns an error if no matching paint dynamics is found.
New in version 2.8.
- Gimp.context_set_emulate_brush_dynamics(emulate_dynamics)¶
- Parameters:
emulate_dynamics (
bool
) – The new emulate brush dynamics setting.- Returns:
True
on success.- Return type:
Set the stroke option’s emulate brush dynamics setting.
This procedure sets the specified emulate brush dynamics setting. The new method will be used in all subsequent stroke operations.
New in version 3.0.
- Gimp.context_set_feather(feather)¶
-
Set the feather setting.
Modifies the feather setting. If the feather option is enabled, selections will be blurred before combining. The blur is a gaussian blur; its radii can be controlled using
Gimp.context_set_feather_radius
().This setting affects the following procedures:
Gimp.Image.select_color
(),Gimp.Image.select_contiguous_color
(),Gimp.Image.select_rectangle
(),Gimp.Image.select_round_rectangle
(),Gimp.Image.select_ellipse
(),Gimp.Image.select_polygon
(),Gimp.Image.select_item
().New in version 2.8.
- Gimp.context_set_feather_radius(feather_radius_x, feather_radius_y)¶
- Parameters:
- Returns:
True
on success.- Return type:
Set the feather radius setting.
Modifies the feather radius setting.
This setting affects all procedures that are affected by
Gimp.context_set_feather
().New in version 2.8.
- Gimp.context_set_font(font)¶
-
Set the active font.
Sets the active font in the current context. The font will be used in subsequent text operations. Returns an error when the font data was uninstalled since the font object was created.
New in version 2.2.
- Gimp.context_set_foreground(foreground)¶
- Parameters:
foreground (
Gegl.Color
) – The foreground color.- Returns:
True
on success.- Return type:
Set the current GIMP foreground color.
Sets the current GIMP foreground color. After this is set, operations which use foreground such as paint tools, blending, and bucket fill will use the new value.
New in version 2.2.
- Gimp.context_set_gradient(gradient)¶
- Parameters:
gradient (
Gimp.Gradient
) – The gradient.- Returns:
True
on success.- Return type:
Sets the active gradient.
Sets the active gradient in the current context. The gradient will be used in subsequent gradient operations. Returns an error when the gradient data was uninstalled since the gradient object was created.
New in version 2.2.
- Gimp.context_set_gradient_blend_color_space(blend_color_space)¶
- Parameters:
blend_color_space (
Gimp.GradientBlendColorSpace
) – Blend color space.- Returns:
True
on success.- Return type:
Set the gradient blend color space.
Set the gradient blend color space for paint tools and the gradient tool.
New in version 2.10.
- Gimp.context_set_gradient_fg_bg_hsv_ccw()¶
-
Sets the built-in FG-BG HSV (ccw) gradient as the active gradient.
Sets the built-in FG-BG HSV (ccw) gradient as the active gradient. The gradient will be used for subsequent gradient operations.
New in version 2.10.
- Gimp.context_set_gradient_fg_bg_hsv_cw()¶
-
Sets the built-in FG-BG HSV (cw) gradient as the active gradient.
Sets the built-in FG-BG HSV (cw) gradient as the active gradient. The gradient will be used for subsequent gradient operations.
New in version 2.10.
- Gimp.context_set_gradient_fg_bg_rgb()¶
-
Sets the built-in FG-BG RGB gradient as the active gradient.
Sets the built-in FG-BG RGB gradient as the active gradient. The gradient will be used for subsequent gradient operations.
New in version 2.10.
- Gimp.context_set_gradient_fg_transparent()¶
-
Sets the built-in FG-Transparent gradient as the active gradient.
Sets the built-in FG-Transparent gradient as the active gradient. The gradient will be used for subsequent gradient operations.
New in version 2.10.
- Gimp.context_set_gradient_repeat_mode(repeat_mode)¶
- Parameters:
repeat_mode (
Gimp.RepeatMode
) – Repeat mode.- Returns:
True
on success.- Return type:
Set the gradient repeat mode.
Set the gradient repeat mode for paint tools and the gradient tool.
New in version 2.10.
- Gimp.context_set_gradient_reverse(reverse)¶
-
Set the gradient reverse setting.
Set the gradient reverse setting for paint tools and the gradient tool.
New in version 2.10.
- Gimp.context_set_ink_angle(angle)¶
-
Set ink angle in degrees.
Set the ink angle in degrees for ink tool.
New in version 2.8.
- Gimp.context_set_ink_blob_angle(angle)¶
-
Set ink blob angle in degrees.
Set the ink blob angle in degrees for ink tool.
New in version 2.8.
- Gimp.context_set_ink_blob_aspect_ratio(aspect)¶
-
Set ink blob aspect ratio.
Set the ink blob aspect ratio for ink tool.
New in version 2.8.
- Gimp.context_set_ink_blob_type(type)¶
- Parameters:
type (
Gimp.InkBlobType
) – Ink blob type.- Returns:
True
on success.- Return type:
Set ink blob type.
Set the ink blob type for ink tool.
New in version 2.8.
- Gimp.context_set_ink_size(size)¶
-
Set ink blob size in pixels.
Set the ink blob size in pixels for ink tool.
New in version 2.8.
- Gimp.context_set_ink_size_sensitivity(size)¶
-
Set ink size sensitivity.
Set the ink size sensitivity for ink tool.
New in version 2.8.
- Gimp.context_set_ink_speed_sensitivity(speed)¶
-
Set ink speed sensitivity.
Set the ink speed sensitivity for ink tool.
New in version 2.8.
- Gimp.context_set_ink_tilt_sensitivity(tilt)¶
-
Set ink tilt sensitivity.
Set the ink tilt sensitivity for ink tool.
New in version 2.8.
- Gimp.context_set_interpolation(interpolation)¶
- Parameters:
interpolation (
Gimp.InterpolationType
) – The interpolation type.- Returns:
True
on success.- Return type:
Set the interpolation type.
Modifies the interpolation setting.
This setting affects affects the following procedures:
Gimp.Item.transform_flip
(),Gimp.Item.transform_perspective
(),Gimp.Item.transform_rotate
(),Gimp.Item.transform_scale
(),Gimp.Item.transform_shear
(),Gimp.Item.transform_2d
(),Gimp.Item.transform_matrix
(),Gimp.Image.scale
(),Gimp.Layer.scale
().New in version 2.8.
- Gimp.context_set_line_cap_style(cap_style)¶
- Parameters:
cap_style (
Gimp.CapStyle
) – The line cap style setting.- Returns:
True
on success.- Return type:
Set the line cap style setting.
Modifies the line cap style setting for stroking lines.
This setting affects the following procedures:
Gimp.Drawable.edit_stroke_selection
(),Gimp.Drawable.edit_stroke_item
().New in version 2.10.
- Gimp.context_set_line_dash_offset(dash_offset)¶
- Parameters:
dash_offset (
float
) – The line dash offset setting.- Returns:
True
on success.- Return type:
Set the line dash offset setting.
Modifies the line dash offset setting for stroking lines.
This setting affects the following procedures:
Gimp.Drawable.edit_stroke_selection
(),Gimp.Drawable.edit_stroke_item
().New in version 2.10.
- Gimp.context_set_line_dash_pattern(dashes)¶
- Parameters:
dashes ([
float
]) – The line dash pattern setting.- Returns:
True
on success.- Return type:
Set the line dash pattern setting.
Modifies the line dash pattern setting for stroking lines.
The unit of the dash pattern segments is the actual line width used for the stroke operation, in other words a segment length of 1.0 results in a square segment shape (or gap shape).
This setting affects the following procedures:
Gimp.Drawable.edit_stroke_selection
(),Gimp.Drawable.edit_stroke_item
().New in version 2.10.
- Gimp.context_set_line_join_style(join_style)¶
- Parameters:
join_style (
Gimp.JoinStyle
) – The line join style setting.- Returns:
True
on success.- Return type:
Set the line join style setting.
Modifies the line join style setting for stroking lines. This setting affects the following procedures:
Gimp.Drawable.edit_stroke_selection
(),Gimp.Drawable.edit_stroke_item
().New in version 2.10.
- Gimp.context_set_line_miter_limit(miter_limit)¶
- Parameters:
miter_limit (
float
) – The line miter limit setting.- Returns:
True
on success.- Return type:
Set the line miter limit setting.
Modifies the line miter limit setting for stroking lines. A mitered join is converted to a bevelled join if the miter would extend to a distance of more than (miter-limit * line-width) from the actual join point.
This setting affects the following procedures:
Gimp.Drawable.edit_stroke_selection
(),Gimp.Drawable.edit_stroke_item
().New in version 2.10.
- Gimp.context_set_line_width(line_width)¶
-
Set the line width setting.
Modifies the line width setting for stroking lines.
This setting affects the following procedures:
Gimp.Drawable.edit_stroke_selection
(),Gimp.Drawable.edit_stroke_item
().New in version 2.10.
- Gimp.context_set_line_width_unit(line_width_unit)¶
- Parameters:
line_width_unit (
Gimp.Unit
) – The line width setting unit.- Returns:
True
on success.- Return type:
Set the line width unit setting.
Modifies the line width unit setting for stroking lines.
This setting affects the following procedures:
Gimp.Drawable.edit_stroke_selection
(),Gimp.Drawable.edit_stroke_item
().New in version 2.10.
- Gimp.context_set_mypaint_brush(name)¶
-
Set a MyPaint brush as the active MyPaint brush.
Sets the active MyPaint brush to the named MyPaint brush. The brush will be used in all subsequent MyPaint paint operations. The name should be a name of an installed MyPaint brush. Returns an error if no matching MyPaint brush is found.
New in version 2.10.
- Gimp.context_set_opacity(opacity)¶
-
Set the opacity.
Modifies the opacity setting. The value should be a floating point number between 0 and 100.
New in version 2.2.
- Gimp.context_set_paint_method(name)¶
-
Set the active paint method.
Sets the active paint method to the named paint method. The paint method will be used in all subsequent paint operations. The name should be a name of an available paint method. Returns an error if no matching paint method is found.
New in version 2.4.
- Gimp.context_set_paint_mode(paint_mode)¶
- Parameters:
paint_mode (
Gimp.LayerMode
) – The paint mode.- Returns:
True
on success.- Return type:
Set the paint mode.
Modifies the paint_mode setting.
New in version 2.2.
- Gimp.context_set_palette(palette)¶
- Parameters:
palette (
Gimp.Palette
) – The palette.- Returns:
True
on success.- Return type:
Set the active palette.
Sets the active palette in the current context. The palette will be used in subsequent paint operations. Returns an error when the palette data was uninstalled since the palette object was created.
New in version 2.2.
- Gimp.context_set_pattern(pattern)¶
- Parameters:
pattern (
Gimp.Pattern
) – The pattern.- Returns:
True
on success.- Return type:
Set the active pattern.
Sets the active pattern in the current context. The pattern will be used in subsequent fill operations using a pattern. Returns an error when the pattern data was uninstalled since the pattern object was created.
New in version 2.2.
- Gimp.context_set_sample_criterion(sample_criterion)¶
- Parameters:
sample_criterion (
Gimp.SelectCriterion
) – The sample criterion setting.- Returns:
True
on success.- Return type:
Set the sample criterion setting.
Modifies the sample criterion setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls how color similarity is determined. SELECT_CRITERION_COMPOSITE is the default value.
This setting affects the following procedures:
Gimp.Image.select_color
(),Gimp.Image.select_contiguous_color
(),Gimp.Drawable.edit_bucket_fill
().New in version 2.8.
- Gimp.context_set_sample_merged(sample_merged)¶
- Parameters:
sample_merged (
bool
) – The sample merged setting.- Returns:
True
on success.- Return type:
Set the sample merged setting.
Modifies the sample merged setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls whether the pixel data from the given drawable is used (‘sample-merged’ is
False
), or the pixel data from the composite image (‘sample-merged’ isTrue
. This is equivalent to sampling for colors after merging all visible layers).This setting affects the following procedures:
Gimp.Image.select_color
(),Gimp.Image.select_contiguous_color
(),Gimp.Drawable.edit_bucket_fill
().New in version 2.8.
- Gimp.context_set_sample_threshold(sample_threshold)¶
- Parameters:
sample_threshold (
float
) – The sample threshold setting.- Returns:
True
on success.- Return type:
Set the sample threshold setting.
Modifies the sample threshold setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls what is \”sufficiently close\” to be considered a similar color. If the sample threshold has not been set explicitly, the default threshold set in gimprc will be used.
This setting affects the following procedures:
Gimp.Image.select_color
(),Gimp.Image.select_contiguous_color
(),Gimp.Drawable.edit_bucket_fill
().New in version 2.8.
- Gimp.context_set_sample_threshold_int(sample_threshold)¶
- Parameters:
sample_threshold (
int
) – The sample threshold setting.- Returns:
True
on success.- Return type:
Set the sample threshold setting as an integer value.
Modifies the sample threshold setting as an integer value. See
Gimp.context_set_sample_threshold
().New in version 2.8.
- Gimp.context_set_sample_transparent(sample_transparent)¶
- Parameters:
sample_transparent (
bool
) – The sample transparent setting.- Returns:
True
on success.- Return type:
Set the sample transparent setting.
Modifies the sample transparent setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls whether transparency is considered to be a unique selectable color. When this setting is
True
, transparent areas can be selected or filled.This setting affects the following procedures:
Gimp.Image.select_color
(),Gimp.Image.select_contiguous_color
(),Gimp.Drawable.edit_bucket_fill
().New in version 2.8.
- Gimp.context_set_stroke_method(stroke_method)¶
- Parameters:
stroke_method (
Gimp.StrokeMethod
) – The new stroke method.- Returns:
True
on success.- Return type:
Set the active stroke method.
Sets the active stroke method. The method will be used in all subsequent stroke operations.
New in version 2.10.
- Gimp.context_set_transform_direction(transform_direction)¶
- Parameters:
transform_direction (
Gimp.TransformDirection
) – The transform direction.- Returns:
True
on success.- Return type:
Set the transform direction.
Modifies the transform direction setting.
This setting affects affects the following procedures:
Gimp.Item.transform_flip
(),Gimp.Item.transform_perspective
(),Gimp.Item.transform_rotate
(),Gimp.Item.transform_scale
(),Gimp.Item.transform_shear
(),Gimp.Item.transform_2d
(),Gimp.Item.transform_matrix
().New in version 2.8.
- Gimp.context_set_transform_resize(transform_resize)¶
- Parameters:
transform_resize (
Gimp.TransformResize
) – The transform resize type.- Returns:
True
on success.- Return type:
Set the transform resize type.
Modifies the transform resize setting. When transforming pixels, if the result of a transform operation has a different size than the original area, this setting determines how the resulting area is sized.
This setting affects affects the following procedures:
Gimp.Item.transform_flip
(),Gimp.Item.transform_flip_simple
(),Gimp.Item.transform_perspective
(),Gimp.Item.transform_rotate
(),Gimp.Item.transform_rotate_simple
(),Gimp.Item.transform_scale
(),Gimp.Item.transform_shear
(),Gimp.Item.transform_2d
(),Gimp.Item.transform_matrix
().New in version 2.8.
- Gimp.context_swap_colors()¶
-
Swap the current GIMP foreground and background colors.
Swaps the current GIMP foreground and background colors, so that the new foreground color becomes the old background color and vice versa.
New in version 2.2.
- Gimp.convolve(drawable, pressure, convolve_type, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.pressure (
float
) – The pressure.convolve_type (
Gimp.ConvolveType
) – Convolve type.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Convolve (Blur, Sharpen) using the current brush.
This tool convolves the specified drawable with either a sharpening or blurring kernel. The pressure parameter controls the magnitude of the operation. Like the paintbrush, this tool linearly interpolates between the specified stroke coordinates.
- Gimp.convolve_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Convolve (Blur, Sharpen) using the current brush.
This tool convolves the specified drawable with either a sharpening or blurring kernel. This function performs exactly the same as the
Gimp.convolve
() function except that the tools arguments are obtained from the convolve option dialog. It this dialog has not been activated then the dialogs default values will be used.
- Gimp.core_object_array_get_length(array)¶
- Parameters:
array (
GObject.Object
) – aNone
-terminated array of objects.- Returns:
the number of [class`GObject`.Object] in array.
- Return type:
- Gimp.core_object_array_get_type()¶
- Return type:
- Gimp.cpu_accel_get_support()¶
- Returns:
Gimp.CpuAccelFlags
as supported by the CPU.- Return type:
Query for CPU acceleration support.
New in version 2.4.
- Gimp.data_directory()¶
- Returns:
The top directory for GIMP data.
- Return type:
Returns the default top directory for GIMP data. If the environment variable GIMP3_DATADIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Windows, the installation directory as deduced from the executable’s full filename is used.
Note that the actual directories used for GIMP data files can be overridden by the user in the preferences dialog.
In config files such as gimprc, the string ${gimp_data_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn’t necessarily UTF-8. (On Windows it always is UTF-8.)
- Gimp.debug_timer_end()¶
- Returns:
The elapsed time, in seconds.
- Return type:
Finishes measuring elapsed time.
This procedure stops the timer started by a previous
Gimp.debug_timer_start
() call, and prints and returns the elapsed time. If there was already an active timer at the time of corresponding call toGimp.debug_timer_start
(), a dummy value is returned.This is a debug utility procedure. It is subject to change at any point, and should not be used in production.
- Gimp.debug_timer_start()¶
-
Starts measuring elapsed time.
This procedure starts a timer, measuring the elapsed time since the call. Each call to this procedure should be matched by a call to
Gimp.debug_timer_end
(), which returns the elapsed time. If there is already an active timer, it is not affected by the call, however, a matchingGimp.debug_timer_end
() call is still required.This is a debug utility procedure. It is subject to change at any point, and should not be used in production.
- Gimp.default_display()¶
- Returns:
the default display ID The object belongs to libgimp and you should not free it.
- Return type:
Returns the default display ID. This corresponds to the display the running procedure’s menu entry was invoked from.
This is a constant value given at plug-in configuration time.
- Gimp.detach_parasite(name)¶
-
Removes a global parasite.
This procedure detaches a global parasite from. It has no return values.
New in version 2.8.
- Gimp.directory()¶
- Returns:
The user-specific GIMP settings directory.
- Return type:
Returns the user-specific GIMP settings directory. If the environment variable GIMP3_DIRECTORY exists, it is used. If it is an absolute path, it is used as is. If it is a relative path, it is taken to be a subdirectory of the home directory. If it is a relative path, and no home directory can be determined, it is taken to be a subdirectory of
Gimp.data_directory
().The usual case is that no GIMP3_DIRECTORY environment variable exists, and then we use the GIMPDIR subdirectory of the local configuration directory:
UNIX: $XDG_CONFIG_HOME (defaults to $HOME/.config/)
Windows: CSIDL_APPDATA
OSX (UNIX exception): the Application Support Directory.
If neither the configuration nor home directory exist,
GLib.get_user_config_dir
() will return {tmp}/{user_name}/.config/ where the temporary directory {tmp} and the {user_name} are determined according to platform rules.In any case, we always return some non-empty string, whether it corresponds to an existing directory or not.
In config files such as gimprc, the string ${gimp_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn’t necessarily UTF-8 (on Windows it is always UTF-8.)
- Gimp.displays_flush()¶
-
Flush all internal changes to the user interface
This procedure takes no arguments and returns nothing except a success status. Its purpose is to flush all pending updates of image manipulations to the user interface. It should be called whenever appropriate.
- Gimp.displays_reconnect(old_image, new_image)¶
- Parameters:
old_image (
Gimp.Image
) – The old image (must have at least one display).new_image (
Gimp.Image
) – The new image (must not have a display).
- Returns:
True
on success.- Return type:
Reconnect displays from one image to another image.
This procedure connects all displays of the old_image to the new_image. If the old_image has no display or new_image already has a display the reconnect is not performed and the procedure returns without success. You should rarely need to use this function.
- Gimp.dodgeburn(drawable, exposure, dodgeburn_type, dodgeburn_mode, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.exposure (
float
) – The exposure of the strokes.dodgeburn_type (
Gimp.DodgeBurnType
) – The type either dodge or burn.dodgeburn_mode (
Gimp.TransferMode
) – The mode.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Dodgeburn image with varying exposure.
Dodgeburn. More details here later.
- Gimp.dodgeburn_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Dodgeburn image with varying exposure. This is the same as the
Gimp.dodgeburn
() function except that the exposure, type and mode are taken from the tools option dialog. If the dialog has not been activated then the defaults as used by the dialog will be used.Dodgeburn. More details here later.
- Gimp.double_array_get_values(array)¶
- Parameters:
array (
Gimp.Array
) – theGimp.Array
representing #double values.- Returns:
a C-array of
float
.- Return type:
[
float
]
- Gimp.double_array_set_values(array, values, static_data)¶
- Parameters:
array (
Gimp.Array
) – the array to modify.values ([
float
]) – the C-array.static_data (
bool
) – whether data is a static rather than allocated array.
- Gimp.drawables_close_popup(callback)¶
- Parameters:
callback (
str
) – The name of the callback registered for this pop-up.- Returns:
True
on success.- Return type:
Close the drawable selection dialog.
Closes an open drawable selection dialog.
- Gimp.drawables_popup(callback, popup_title, drawable_type, initial_drawable, parent_window)¶
- Parameters:
callback (
str
) – The callback PDB proc to call when user chooses an drawable.popup_title (
str
) – Title of the drawable selection dialog.drawable_type (
str
) – The name of the GIMP_TYPE_DRAWABLE subtype.initial_drawable (
Gimp.Drawable
orNone
) – The drawable to set as the initial choice.parent_window (
GLib.Bytes
orNone
) – An optional parent window handle for the popup to be set transient to.
- Returns:
True
on success.- Return type:
Invokes the drawable selection dialog.
Opens a dialog letting a user choose an drawable.
- Gimp.drawables_set_popup(callback, drawable)¶
- Parameters:
callback (
str
) – The name of the callback registered for this pop-up.drawable (
Gimp.Drawable
) – The drawable to set as selected.
- Returns:
True
on success.- Return type:
Sets the selected drawable in a drawable selection dialog.
Sets the selected drawable in a drawable selection dialog.
- Gimp.dynamics_get_name_list(filter)¶
- Parameters:
filter (
str
orNone
) – An optional regular expression used to filter the list.- Returns:
The list of paint dynamics names. The returned value must be freed with
GLib.strfreev
().- Return type:
[
str
]
Retrieve the list of loaded paint dynamics.
This procedure returns a list of the paint dynamics that are currently available.
New in version 2.8.
- Gimp.dynamics_refresh()¶
-
Refresh current paint dynamics. This function always succeeds.
This procedure retrieves all paint dynamics currently in the user’s paint dynamics path and updates the paint dynamics dialogs accordingly.
New in version 2.8.
- Gimp.edit_copy(drawables)¶
- Parameters:
drawables ([
Gimp.Drawable
]) – Drawables to copy from.- Returns:
True
if the cut was successful,False
if there was nothing to copy from.- Return type:
Copy from the specified drawables.
If there is a selection in the image, then the area specified by the selection is copied from the specified drawables and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the
Gimp.edit_paste
() command. If there is no selection, then the specified drawables’ contents will be stored in the internal GIMP edit buffer. This procedure will returnFalse
if the selected area lies completely outside the bounds of the current drawables and there is nothing to copy from. All the drawables must belong to the same image.
- Gimp.edit_copy_visible(image)¶
- Parameters:
image (
Gimp.Image
) – The image to copy from.- Returns:
True
if the copy was successful.- Return type:
Copy from the projection.
If there is a selection in the image, then the area specified by the selection is copied from the projection and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the
Gimp.edit_paste
() command. If there is no selection, then the projection’s contents will be stored in the internal GIMP edit buffer.New in version 2.2.
- Gimp.edit_cut(drawables)¶
- Parameters:
drawables ([
Gimp.Drawable
]) – The drawables to cut from.- Returns:
True
if the cut was successful,False
if there was nothing to copy from.- Return type:
Cut from the specified drawables.
If there is a selection in the image, then the area specified by the selection is cut from the specified drawables and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the
Gimp.edit_paste
() command. If there is no selection and only one specified drawable, then the specified drawable will be removed and its contents stored in the internal GIMP edit buffer. This procedure will returnFalse
if the selected area lies completely outside the bounds of the current drawables and there is nothing to cut from.
- Gimp.edit_named_copy(drawables, buffer_name)¶
- Parameters:
drawables ([
Gimp.Drawable
]) – The drawables to copy from.buffer_name (
str
) – The name of the buffer to create.
- Returns:
The real name given to the buffer, or
None
if the copy failed. The returned value must be freed withGLib.free
().- Return type:
Copy into a named buffer.
This procedure works like
Gimp.edit_copy
(), but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.New in version 2.4.
- Gimp.edit_named_copy_visible(image, buffer_name)¶
- Parameters:
image (
Gimp.Image
) – The image to copy from.buffer_name (
str
) – The name of the buffer to create.
- Returns:
The real name given to the buffer, or
None
if the copy failed. The returned value must be freed withGLib.free
().- Return type:
Copy from the projection into a named buffer.
This procedure works like
Gimp.edit_copy_visible
(), but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.New in version 2.4.
- Gimp.edit_named_cut(drawables, buffer_name)¶
- Parameters:
drawables ([
Gimp.Drawable
]) – The drawables to cut from.buffer_name (
str
) – The name of the buffer to create.
- Returns:
The real name given to the buffer, or
None
if the cut failed. The returned value must be freed withGLib.free
().- Return type:
Cut into a named buffer.
This procedure works like
Gimp.edit_cut
(), but additionally stores the cut buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.New in version 2.4.
- Gimp.edit_named_paste(drawable, buffer_name, paste_into)¶
- Parameters:
drawable (
Gimp.Drawable
) – The drawable to paste to.buffer_name (
str
) – The name of the buffer to paste.paste_into (
bool
) – Clear selection, or paste behind it?
- Returns:
The new floating selection.
- Return type:
Paste named buffer to the specified drawable.
This procedure works like
Gimp.edit_paste
() but pastes a named buffer instead of the global buffer.New in version 2.4.
- Gimp.edit_named_paste_as_new_image(buffer_name)¶
- Parameters:
buffer_name (
str
) – The name of the buffer to paste.- Returns:
The new image.
- Return type:
Paste named buffer to a new image.
This procedure works like
Gimp.edit_paste_as_new_image
() but pastes a named buffer instead of the global buffer.New in version 2.10.
- Gimp.edit_paste(drawable, paste_into)¶
- Parameters:
drawable (
Gimp.Drawable
) – The drawable to paste to.paste_into (
bool
) – Clear selection, or paste behind it?
- Returns:
The list of pasted layers. The returned value must be freed with
GLib.free
().- Return type:
Paste buffer to the specified drawable.
This procedure pastes a copy of the internal GIMP edit buffer to the specified drawable. The GIMP edit buffer will be empty unless a call was previously made to either [func`Gimp`.edit_cut] or [func`Gimp`.edit_copy]. The \”paste_into\” option specifies whether to clear the current image selection, or to paste the buffer \”behind\” the selection. This allows the selection to act as a mask for the pasted buffer. Anywhere that the selection mask is non-zero, the pasted buffer will show through. The pasted data may be a floating selection when relevant, layers otherwise. If the image has a floating selection at the time of pasting, the old floating selection will be anchored to its drawable before the new floating selection is added. This procedure returns the new drawables (floating or not). If the result is a floating selection, it will already be attached to the specified drawable, and a subsequent call to [func`Gimp`.floating_sel_attach] is not needed.
- Gimp.edit_paste_as_new_image()¶
- Returns:
The new image.
- Return type:
Paste buffer to a new image.
This procedure pastes a copy of the internal GIMP edit buffer to a new image. The GIMP edit buffer will be empty unless a call was previously made to either
Gimp.edit_cut
() orGimp.edit_copy
(). This procedure returns the new image or -1 if the edit buffer was empty.New in version 2.10.
- Gimp.enum_get_desc(enum_class, value)¶
- Parameters:
enum_class (
GObject.EnumClass
) – aGObject.EnumClass
value (
int
) – a value from enum_class
- Returns:
the value’s
Gimp.EnumDesc
.- Return type:
Retrieves
Gimp.EnumDesc
associated with the given value, orNone
.New in version 2.2.
- Gimp.enum_get_value(enum_type, value)¶
- Parameters:
enum_type (
GObject.GType
) – theGObject.GType
of a registered enumvalue (
int
) – an integer value
- Returns:
- Return type:
(
bool
, value_name:str
, value_nick:str
, value_desc:str
, value_help:str
)
Checks if value is valid for the enum registered as enum_type. If the value exists in that enum, its name, nick and its translated description and help are returned (if value_name, value_nick, value_desc and value_help are not
None
).New in version 2.2.
- Gimp.enum_get_value_descriptions(enum_type)¶
- Parameters:
enum_type (
GObject.GType
) – aGObject.GType
- Returns:
a
None
terminated constant array ofGimp.EnumDesc
- Return type:
Retrieves the array of human readable and translatable descriptions and help texts for enum values.
New in version 2.2.
- Gimp.enum_set_value_descriptions(enum_type, descriptions)¶
- Parameters:
enum_type (
GObject.GType
) – aGObject.GType
descriptions (
Gimp.EnumDesc
) – aNone
terminated constant static array ofGimp.EnumDesc
Sets the array of human readable and translatable descriptions and help texts for enum values.
New in version 2.2.
- Gimp.enum_value_get_abbrev(enum_class, enum_value)¶
- Parameters:
enum_class (
GObject.EnumClass
) – aGObject.EnumClass
enum_value (
GObject.EnumValue
) – aGObject.EnumValue
from enum_class
- Returns:
the translated abbreviation of the enum value
- Return type:
Retrieves the translated abbreviation for a given enum_value.
New in version 2.10.
- Gimp.enum_value_get_desc(enum_class, enum_value)¶
- Parameters:
enum_class (
GObject.EnumClass
) – aGObject.EnumClass
enum_value (
GObject.EnumValue
) – aGObject.EnumValue
from enum_class
- Returns:
the translated description of the enum value
- Return type:
Retrieves the translated description for a given enum_value.
New in version 2.2.
- Gimp.enum_value_get_help(enum_class, enum_value)¶
- Parameters:
enum_class (
GObject.EnumClass
) – aGObject.EnumClass
enum_value (
GObject.EnumValue
) – aGObject.EnumValue
from enum_class
- Returns:
the translated help of the enum value
- Return type:
Retrieves the translated help for a given enum_value.
New in version 2.2.
- Gimp.enums_get_type_names()¶
- Returns:
an array with type names
- Return type:
[
str
]
This function gives access to the list of enums registered by libgimp. The returned array is static and must not be modified.
New in version 2.2.
- Gimp.enums_init()¶
This function makes sure all the enum types are registered with the
GObject.GType
system. This is intended for use by language bindings that need the symbols early, beforeGimp.main
is run. It’s not necessary for plug-ins to call this directly, because the normal plug-in initialization code will handle it implicitly.New in version 2.4.
- Gimp.eraser(drawable, strokes, hardness, method)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.hardness (
Gimp.BrushApplicationMode
) – How to apply the brush.method (
Gimp.PaintApplicationMode
) – The paint method to use.
- Returns:
True
on success.- Return type:
Erase using the current brush.
This tool erases using the current brush mask. If the specified drawable contains an alpha channel, then the erased pixels will become transparent. Otherwise, the eraser tool replaces the contents of the drawable with the background color. Like paintbrush, this tool linearly interpolates between the specified stroke coordinates.
- Gimp.eraser_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Erase using the current brush.
This tool erases using the current brush mask. This function performs exactly the same as the
Gimp.eraser
() function except that the tools arguments are obtained from the eraser option dialog. It this dialog has not been activated then the dialogs default values will be used.
- Gimp.escape_uline(str)¶
- Parameters:
- Returns:
A (possibly escaped) copy of str which should be freed using
GLib.free
() when it is not needed any longer.- Return type:
This function returns a copy of str with all underline converted to two adjacent underlines. This comes in handy when needing to display strings with underlines (like filenames) in a place that would convert them to mnemonics.
New in version 2.2.
- Gimp.export_color_profile()¶
-
Returns whether file plug-ins should default to exporting the image’s color profile.
New in version 2.10.4.
- Gimp.export_comment()¶
-
Returns whether file plug-ins should default to exporting the image’s comment.
New in version 3.0.
- Gimp.export_exif()¶
-
Returns whether file plug-ins should default to exporting Exif metadata, according preferences (original settings is
False
since metadata can contain sensitive information).New in version 2.10.
- Gimp.export_iptc()¶
-
Returns whether file plug-ins should default to exporting IPTC metadata, according preferences (original settings is
False
since metadata can contain sensitive information).New in version 2.10.
- Gimp.export_thumbnail()¶
-
Returns whether file plug-ins should default to exporting the image’s comment.
New in version 3.0.
- Gimp.export_xmp()¶
-
Returns whether file plug-ins should default to exporting XMP metadata, according preferences (original settings is
False
since metadata can contain sensitive information).New in version 2.10.
- Gimp.file_create_thumbnail(image, file)¶
- Parameters:
image (
Gimp.Image
) – The image.file (
Gio.File
) – The file the thumbnail belongs to.
- Returns:
True
on success.- Return type:
Creates a thumbnail of image for the given file
This procedure creates a thumbnail for the given file and stores it according to relevant standards. In particular, it will follow the Free Desktop Thumbnail Managing Standard when relevant.
The thumbnail is stored so that it belongs to the given file. This means you have to save image under this name first. As a fallback, the call will work if image was exported or imported as file. In any other case, this procedure will fail.
- Gimp.file_get_config_path(file)¶
- Parameters:
- Raises:
- Returns:
a newly allocated NUL-terminated UTF-8 string, or
None
if unexpanding failed.- Return type:
Unexpands file's path using
Gimp.ConfigPath.unexpand
() and returns the unexpanded path.The inverse operation of
Gimp.file_new_for_config_path
().New in version 2.10.
- Gimp.file_get_utf8_name(file)¶
- Parameters:
- Returns:
A temporarily valid UTF-8 representation of file's name. This string must not be changed or freed.
- Return type:
This function works like
Gimp.filename_to_utf8
() and returns a UTF-8 encoded string that does not need to be freed.It converts a
Gio.File
's path or uri to UTF-8 temporarily. The return value is a pointer to a string that is guaranteed to be valid only during the current iteration of the main loop or until the next call toGimp.file_get_utf8_name
().The only purpose of this function is to provide an easy way to pass a
Gio.File
's name to a function that expects an UTF-8 encoded string.See
Gio.File.get_parse_name
().New in version 2.10.
- Gimp.file_has_extension(file, extension)¶
- Parameters:
- Returns:
- Return type:
This function checks if file's URI ends with extension. It behaves like
GLib.str_has_suffix
() onGio.File.get_uri
(), except that the string comparison is done case-insensitively usingGLib.ascii_strcasecmp
().New in version 2.10.
- Gimp.file_load(run_mode, file)¶
- Parameters:
run_mode (
Gimp.RunMode
) – The run mode.file (
Gio.File
) – The file to load.
- Returns:
The output image.
- Return type:
Loads an image file by invoking the right load handler.
This procedure invokes the correct file load handler using magic if possible, and falling back on the file’s extension and/or prefix if not.
- Gimp.file_load_layer(run_mode, image, file)¶
- Parameters:
run_mode (
Gimp.RunMode
) – The run mode.image (
Gimp.Image
) – Destination image.file (
Gio.File
) – The file to load.
- Returns:
The layer created when loading the image file.
- Return type:
Loads an image file as a layer for an existing image.
This procedure behaves like the file-load procedure but opens the specified image as a layer for an existing image. The returned layer needs to be added to the existing image with
Gimp.Image.insert_layer
().New in version 2.4.
- Gimp.file_load_layers(run_mode, image, file)¶
- Parameters:
run_mode (
Gimp.RunMode
) – The run mode.image (
Gimp.Image
) – Destination image.file (
Gio.File
) – The file to load.
- Returns:
The list of loaded layers. The returned value must be freed with
GLib.free
().- Return type:
Loads an image file as layers for an existing image.
This procedure behaves like the file-load procedure but opens the specified image as layers for an existing image. The returned layers needs to be added to the existing image with
Gimp.Image.insert_layer
().New in version 2.4.
- Gimp.file_new_for_config_path(path)¶
- Parameters:
path (
str
) – a NUL-terminated string in UTF-8 encoding- Raises:
- Returns:
a newly allocated
Gio.File
, orNone
if the expansion failed.- Return type:
Expands path using
Gimp.ConfigPath.expand
() and returns aGio.File
for the expanded path.To reverse the expansion, use
Gimp.file_get_config_path
().New in version 2.10.
- Gimp.file_save(run_mode, image, file, options)¶
- Parameters:
run_mode (
Gimp.RunMode
) – The run mode.image (
Gimp.Image
) – Input image.file (
Gio.File
) – The file to save or export the image in.options (
Gimp.ExportOptions
orNone
) – Export option settings.
- Returns:
True
on success.- Return type:
Saves to XCF or export image to any supported format by extension.
This procedure invokes the correct file save/export handler according to file's extension and/or prefix.
The options argument is currently unused and should be set to
None
right now.
- Gimp.file_show_in_file_manager(file)¶
- Parameters:
- Raises:
- Returns:
- Return type:
Shows file in the system file manager.
New in version 2.10.
- Gimp.filename_to_utf8(filename)¶
- Parameters:
filename (
str
) – The filename to be converted to UTF-8.- Returns:
A temporarily valid UTF-8 representation of filename. This string must not be changed or freed.
- Return type:
Convert a filename in the filesystem’s encoding to UTF-8 temporarily. The return value is a pointer to a string that is guaranteed to be valid only during the current iteration of the main loop or until the next call to
Gimp.filename_to_utf8
().The only purpose of this function is to provide an easy way to pass a filename in the filesystem encoding to a function that expects an UTF-8 encoded filename.
- Gimp.flags_get_first_desc(flags_class, value)¶
- Parameters:
flags_class (
GObject.FlagsClass
) – aGObject.FlagsClass
value (
int
) – a value from flags_class
- Returns:
the value’s
Gimp.FlagsDesc
.- Return type:
Retrieves the first
Gimp.FlagsDesc
that matches the given value, orNone
.New in version 2.2.
- Gimp.flags_get_first_value(flags_type, value)¶
- Parameters:
flags_type (
GObject.GType
) – theGObject.GType
of registered flagsvalue (
int
) – an integer value
- Returns:
- Return type:
(
bool
, value_name:str
, value_nick:str
, value_desc:str
, value_help:str
)
Checks if value is valid for the flags registered as flags_type. If the value exists in that flags, its name, nick and its translated description and help are returned (if value_name, value_nick, value_desc and value_help are not
None
).New in version 2.2.
- Gimp.flags_get_value_descriptions(flags_type)¶
- Parameters:
flags_type (
GObject.GType
) – aGObject.GType
- Returns:
a
None
terminated constant array ofGimp.FlagsDesc
- Return type:
Retrieves the array of human readable and translatable descriptions and help texts for flags values.
New in version 2.2.
- Gimp.flags_set_value_descriptions(flags_type, descriptions)¶
- Parameters:
flags_type (
GObject.GType
) – aGObject.GType
descriptions (
Gimp.FlagsDesc
) – aNone
terminated constant static array ofGimp.FlagsDesc
Sets the array of human readable and translatable descriptions and help texts for flags values.
New in version 2.2.
- Gimp.flags_value_get_abbrev(flags_class, flags_value)¶
- Parameters:
flags_class (
GObject.FlagsClass
) – aGObject.FlagsClass
flags_value (
GObject.FlagsValue
) – aGObject.FlagsValue
from flags_class
- Returns:
the translated abbreviation of the flags value
- Return type:
Retrieves the translated abbreviation for a given flags_value.
New in version 2.10.
- Gimp.flags_value_get_desc(flags_class, flags_value)¶
- Parameters:
flags_class (
GObject.FlagsClass
) – aGObject.FlagsClass
flags_value (
GObject.FlagsValue
) – aGObject.FlagsValue
from flags_class
- Returns:
the translated description of the flags value
- Return type:
Retrieves the translated description for a given flags_value.
New in version 2.2.
- Gimp.flags_value_get_help(flags_class, flags_value)¶
- Parameters:
flags_class (
GObject.FlagsClass
) – aGObject.FlagsClass
flags_value (
GObject.FlagsValue
) – aGObject.FlagsValue
from flags_class
- Returns:
the translated help of the flags value
- Return type:
Retrieves the translated help for a given flags_value.
New in version 2.2.
- Gimp.floating_sel_anchor(floating_sel)¶
- Parameters:
floating_sel (
Gimp.Layer
) – The floating selection.- Returns:
True
on success.- Return type:
Anchor the specified floating selection to its associated drawable.
This procedure anchors the floating selection to its associated drawable. This is similar to merging with a merge type of ClipToBottomLayer. The floating selection layer is no longer valid after this operation.
- Gimp.floating_sel_attach(layer, drawable)¶
- Parameters:
layer (
Gimp.Layer
) – The layer (is attached as floating selection).drawable (
Gimp.Drawable
) – The drawable (where to attach the floating selection).
- Returns:
True
on success.- Return type:
Attach the specified layer as floating to the specified drawable.
This procedure attaches the layer as floating selection to the drawable.
- Gimp.floating_sel_remove(floating_sel)¶
- Parameters:
floating_sel (
Gimp.Layer
) – The floating selection.- Returns:
True
on success.- Return type:
Remove the specified floating selection from its associated drawable.
This procedure removes the floating selection completely, without any side effects. The associated drawable is then set to active.
- Gimp.floating_sel_to_layer(floating_sel)¶
- Parameters:
floating_sel (
Gimp.Layer
) – The floating selection.- Returns:
True
on success.- Return type:
Transforms the specified floating selection into a layer.
This procedure transforms the specified floating selection into a layer with the same offsets and extents. The composited image will look precisely the same, but the floating selection layer will no longer be clipped to the extents of the drawable it was attached to. The floating selection will become the active layer. This procedure will not work if the floating selection has a different base type from the underlying image. This might be the case if the floating selection is above an auxiliary channel or a layer mask.
- Gimp.fonts_close_popup(font_callback)¶
- Parameters:
font_callback (
str
) – The name of the callback registered in the PDB for this dialog.- Returns:
True
on success.- Return type:
Close the font selection dialog.
Closes an open font selection dialog.
- Gimp.fonts_get_list(filter)¶
- Parameters:
filter (
str
orNone
) – An optional regular expression used to filter the list.- Returns:
The list of fonts. The returned value must be freed with
GLib.free
().- Return type:
Retrieve the list of loaded fonts.
This procedure returns a list of the fonts that are currently available. Each font returned can be used as input to [func`Gimp`.context_set_font].
- Gimp.fonts_popup(font_callback, popup_title, initial_font, parent_window)¶
- Parameters:
font_callback (
str
) – The callback PDB proc to call when user chooses a font.popup_title (
str
) – Title of the font selection dialog.initial_font (
Gimp.Font
orNone
) – The name of the initial font choice.parent_window (
GLib.Bytes
orNone
) – An optional parent window handle for the popup to be set transient to.
- Returns:
True
on success.- Return type:
Invokes the Gimp font selection dialog.
Opens a dialog letting a user choose a font.
- Gimp.fonts_refresh()¶
-
Refresh current fonts. This function always succeeds.
This procedure retrieves all fonts currently in the user’s font path and updates the font dialogs accordingly. Depending on the amount of fonts on the system, this can take considerable time.
- Gimp.fonts_set_popup(font_callback, font)¶
- Parameters:
- Returns:
True
on success.- Return type:
Sets the current font in a font selection dialog.
Sets the current font in a font selection dialog.
- Gimp.get_color_configuration()¶
- Returns:
A copy of the core’s
Gimp.ColorConfig
. You should unref this copy if you don’t need it any longer.- Return type:
Retrieve a copy of the current color management configuration.
New in version 2.4.
- Gimp.get_default_comment()¶
-
Get the default image comment as specified in the Preferences.
Returns a copy of the default image comment.
- Gimp.get_default_unit()¶
- Returns:
Default unit.
- Return type:
Get the default unit (taken from the user’s locale).
Returns the default unit.
New in version 2.4.
- Gimp.get_images()¶
- Returns:
The list of images currently open. The returned value must be freed with
GLib.free
().- Return type:
Returns the list of images currently open.
This procedure returns the list of images currently open in GIMP.
- Gimp.get_module_load_inhibit()¶
-
Get the list of modules which should not be loaded.
Returns a copy of the list of modules which should not be loaded.
- Gimp.get_monitor_resolution()¶
- Returns:
True
on success.- xres:
X resolution.
- yres:
Y resolution.
- Return type:
Get the monitor resolution as specified in the Preferences.
Returns the resolution of the monitor in pixels/inch. This value is taken from the Preferences (or the windowing system if this is set in the Preferences) and there’s no guarantee for the value to be reasonable.
- Gimp.get_num_processors()¶
- Returns:
the preferred number of threads to use.
- Return type:
Returns the number of threads set explicitly by the user in the preferences. This information can be used by plug-ins wishing to follow user settings for multi-threaded implementations.
New in version 3.0.
- Gimp.get_parasite(name)¶
- Parameters:
name (
str
) – The name of the parasite to find.- Returns:
The found parasite.
- Return type:
Look up a global parasite.
Finds and returns the global parasite that was previously attached.
New in version 2.8.
- Gimp.get_parasite_list()¶
- Returns:
The names of currently attached parasites. The returned value must be freed with
GLib.strfreev
().- Return type:
[
str
]
List all parasites.
Returns a list of all currently attached global parasites.
New in version 2.8.
- Gimp.get_pdb()¶
-
This function returns the plug-in’s
Gimp.PDB
instance, which is a singleton that can exist exactly once per running plug-in.New in version 3.0.
- Gimp.get_plug_in()¶
- Returns:
The plug-in’s
Gimp.PlugIn
singleton.- Return type:
Gimp.PlugIn
orNone
This function returns the plug-in’s
Gimp.PlugIn
instance, which is a a singleton that can exist exactly once per running plug-in.New in version 3.0.
- Gimp.get_progname()¶
- Returns:
the executable name
- Return type:
Returns the plug-in’s executable name.
- Gimp.getpid()¶
- Returns:
The PID.
- Return type:
Returns the PID of the host GIMP process.
This procedure returns the process ID of the currently running GIMP.
New in version 2.4.
- Gimp.gimprc_query(token)¶
- Parameters:
token (
str
) – The token to query for.- Returns:
The value associated with the queried token. The returned value must be freed with
GLib.free
().- Return type:
Queries the gimprc file parser for information on a specified token.
This procedure is used to locate additional information contained in the gimprc file considered extraneous to the operation of GIMP. Plug-ins that need configuration information can expect it will be stored in the user gimprc file and can use this procedure to retrieve it. This query procedure will return the value associated with the specified token. This corresponds _only_ to entries with the format: (<token> <value>). The value must be a string. Entries not corresponding to this format will cause warnings to be issued on gimprc parsing and will not be queryable.
- Gimp.gimprc_set(token, value)¶
- Parameters:
- Returns:
True
on success.- Return type:
Sets a gimprc token to a value and saves it in the gimprc.
This procedure is used to add or change additional information in the gimprc file that is considered extraneous to the operation of GIMP. Plug-ins that need configuration information can use this function to store it, and
Gimp.gimprc_query
() to retrieve it. This will accept _only_ string values in UTF-8 encoding.
- Gimp.gradients_close_popup(gradient_callback)¶
- Parameters:
gradient_callback (
str
) – The name of the callback registered for this pop-up.- Returns:
True
on success.- Return type:
Close the gradient selection dialog.
Closes an open gradient selection dialog.
- Gimp.gradients_get_list(filter)¶
- Parameters:
filter (
str
orNone
) – An optional regular expression used to filter the list.- Returns:
The list of gradients. The returned value must be freed with
GLib.free
().- Return type:
Retrieve the list of loaded gradients.
This procedure returns a list of the gradients that are currently loaded. Each gradient returned can be used as input to [func`Gimp`.context_set_gradient].
- Gimp.gradients_popup(gradient_callback, popup_title, initial_gradient, parent_window)¶
- Parameters:
gradient_callback (
str
) – The callback PDB proc to call when user chooses a gradient.popup_title (
str
) – Title of the gradient selection dialog.initial_gradient (
Gimp.Gradient
orNone
) – The initial gradient choice.parent_window (
GLib.Bytes
orNone
) – An optional parent window handle for the popup to be set transient to.
- Returns:
True
on success.- Return type:
Invokes the Gimp gradients selection dialog.
Opens a dialog letting a user choose a gradient.
- Gimp.gradients_refresh()¶
-
Refresh current gradients. This function always succeeds.
This procedure retrieves all gradients currently in the user’s gradient path and updates the gradient dialogs accordingly.
- Gimp.gradients_set_popup(gradient_callback, gradient)¶
- Parameters:
gradient_callback (
str
) – The name of the callback registered for this pop-up.gradient (
Gimp.Gradient
) – The gradient to set as selected.
- Returns:
True
on success.- Return type:
Sets the current gradient in a gradient selection dialog.
Sets the current gradient in a gradient selection dialog.
- Gimp.heal(drawable, src_drawable, src_x, src_y, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.src_drawable (
Gimp.Drawable
) – The source drawable.src_x (
float
) – The x coordinate in the source image.src_y (
float
) – The y coordinate in the source image.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Heal from the source to the dest drawable using the current brush
This tool heals the source drawable starting at the specified source coordinates to the dest drawable. For image healing, if the sum of the src coordinates and subsequent stroke offsets exceeds the extents of the src drawable, then no paint is transferred. The healing tool is capable of transforming between any image types except RGB->Indexed.
New in version 2.4.
- Gimp.heal_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Heal from the source to the dest drawable using the current brush
This tool heals from the source drawable starting at the specified source coordinates to the dest drawable. This function performs exactly the same as the
Gimp.heal
() function except that the tools arguments are obtained from the healing option dialog. It this dialog has not been activated then the dialogs default values will be used.New in version 2.4.
- Gimp.help(help_domain, help_id)¶
- Parameters:
- Returns:
True
on success.- Return type:
Load a help page.
This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The help page is identified by its domain and ID: if help_domain is
None
, we use the help_domain which was registered using the gimp_plugin_help_register() procedure. If help_domain isNone
and no help domain was registered, the help domain of the main GIMP installation is used.
- Gimp.icon_theme_dir()¶
- Returns:
the icon theme directory
- Return type:
Returns the directory of the current icon theme.
This is a constant value given at plug-in configuration time.
New in version 2.10.4.
- Gimp.installation_directory()¶
- Returns:
The toplevel installation directory of GIMP.
- Return type:
Returns the top installation directory of GIMP. On Unix the compile-time defined installation prefix is used. On Windows, the installation directory as deduced from the executable’s full filename is used. On OSX we ask [NSBundle mainBundle] for the resource path to check if GIMP is part of a relocatable bundle.
In config files such as gimprc, the string ${gimp_installation_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn’t necessarily UTF-8. (On Windows it always is UTF-8.)
New in version 2.8.
- Gimp.int32_array_get_values(array)¶
- Parameters:
array (
Gimp.Array
) – theGimp.Array
representing #int32 values.- Returns:
a C-array of #gint32.
- Return type:
[
int
]
- Gimp.int32_array_set_values(array, values, static_data)¶
- Parameters:
array (
Gimp.Array
) – the array to modify.values ([
int
]) – the C-array.static_data (
bool
) – whether data is a static rather than allocated array.
- Gimp.is_canonical_identifier(identifier)¶
- Parameters:
identifier (
str
) – The identifier string to check.- Returns:
- Return type:
Checks if identifier is canonical and non-
None
.Canonical identifiers are e.g. expected by the PDB for procedure and parameter names. Every character of the input string must be either ‘-’, ‘a-z’, ‘A-Z’ or ‘0-9’.
New in version 3.0.
- Gimp.locale_directory()¶
- Returns:
The top directory for GIMP locale files.
- Return type:
Returns the top directory for GIMP locale files. If the environment variable GIMP3_LOCALEDIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Windows, the installation directory as deduced from the executable’s full filename is used.
The returned string is owned by GIMP and must not be modified or freed. The returned string encoding depends on the system where GIMP is running: on UNIX it’s in the encoding used for filenames by the C library (which isn’t necessarily UTF-8); on Windows it’s UTF-8.
On UNIX the returned string can be passed directly to the bindtextdomain() function from libintl; on Windows the returned string can be converted to UTF-16 and passed to the wbindtextdomain() function from libintl.
- Gimp.main(plug_in_type, argv)¶
- Parameters:
plug_in_type (
GObject.GType
) – the type of theGimp.PlugIn
subclass of the plug-inargv ([
str
]) – the arguments
- Returns:
an exit status as defined by the C library, on success
EXIT_SUCCESS
.- Return type:
The main plug-in function that must be called with the plug-in’s [class`Gimp`.PlugIn] subclass
GObject.GType
and the ‘argc’ and ‘argv’ that are passed to the platform’smain()
.For instance, in Python, you will want to end your plug-in with this call:
``py Gimp.main(MyPlugIn.__gtype__, sys.argv) ``
For C plug-ins, use instead the [func`Gimp`.MAIN] macro
New in version 3.0.
- Gimp.message(message)¶
- Parameters:
message (
str
) – Message to display in the dialog.- Returns:
True
on success.- Return type:
Displays a dialog box with a message.
Displays a dialog box with a message. Useful for status or error reporting. The message must be in UTF-8 encoding.
- Gimp.message_get_handler()¶
- Returns:
The current handler type.
- Return type:
Returns the current state of where warning messages are displayed.
This procedure returns the way g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.
- Gimp.message_set_handler(handler)¶
- Parameters:
handler (
Gimp.MessageHandlerType
) – The new handler type.- Returns:
True
on success.- Return type:
Controls where warning messages are displayed.
This procedure controls how g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.
- Gimp.monitor_number()¶
- Returns:
the monitor number
- Return type:
Returns the monitor number to be used for plug-in windows.
This is a constant value given at plug-in configuration time.
- Gimp.paintbrush(drawable, fade_out, strokes, method, gradient_length)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.fade_out (
float
) – Fade out parameter.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.method (
Gimp.PaintApplicationMode
) – The paint method to use.gradient_length (
float
) – Length of gradient to draw.
- Returns:
True
on success.- Return type:
Paint in the current brush with optional fade out parameter and pull colors from a gradient.
This tool is the standard paintbrush. It draws linearly interpolated lines through the specified stroke coordinates. It operates on the specified drawable in the foreground color with the active brush. The ‘fade-out’ parameter is measured in pixels and allows the brush stroke to linearly fall off. The pressure is set to the maximum at the beginning of the stroke. As the distance of the stroke nears the fade-out value, the pressure will approach zero. The gradient-length is the distance to spread the gradient over. It is measured in pixels. If the gradient-length is 0, no gradient is used.
- Gimp.paintbrush_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Paint in the current brush. The fade out parameter and pull colors from a gradient parameter are set from the paintbrush options dialog. If this dialog has not been activated then the dialog defaults will be used.
This tool is similar to the standard paintbrush. It draws linearly interpolated lines through the specified stroke coordinates. It operates on the specified drawable in the foreground color with the active brush. The ‘fade-out’ parameter is measured in pixels and allows the brush stroke to linearly fall off (value obtained from the option dialog). The pressure is set to the maximum at the beginning of the stroke. As the distance of the stroke nears the fade-out value, the pressure will approach zero. The gradient-length (value obtained from the option dialog) is the distance to spread the gradient over. It is measured in pixels. If the gradient-length is 0, no gradient is used.
- Gimp.palettes_close_popup(palette_callback)¶
- Parameters:
palette_callback (
str
) – The name of the callback registered for this pop-up.- Returns:
True
on success.- Return type:
Close the palette selection dialog.
Closes an open palette selection dialog.
- Gimp.palettes_get_list(filter)¶
- Parameters:
filter (
str
orNone
) – An optional regular expression used to filter the list.- Returns:
The list of palettes. The returned value must be freed with
GLib.free
().- Return type:
Retrieves a list of all of the available palettes
This procedure returns a complete listing of available palettes. Each palette returned can be used as input to [func`Gimp`.context_set_palette].
- Gimp.palettes_popup(palette_callback, popup_title, initial_palette, parent_window)¶
- Parameters:
palette_callback (
str
) – The callback PDB proc to call when user chooses a palette.popup_title (
str
) – Title of the palette selection dialog.initial_palette (
Gimp.Palette
orNone
) – The palette to set as the initial choice.parent_window (
GLib.Bytes
orNone
) – An optional parent window handle for the popup to be set transient to.
- Returns:
True
on success.- Return type:
Invokes the Gimp palette selection dialog.
Opens a dialog letting a user choose a palette.
- Gimp.palettes_refresh()¶
-
Refreshes current palettes. This function always succeeds.
This procedure retrieves all palettes currently in the user’s palette path and updates the palette dialogs accordingly.
- Gimp.palettes_set_popup(palette_callback, palette)¶
- Parameters:
palette_callback (
str
) – The name of the callback registered for this pop-up.palette (
Gimp.Palette
) – The palette to set as selected.
- Returns:
True
on success.- Return type:
Sets the current palette in a palette selection dialog.
Sets the current palette in a palette selection dialog.
- Gimp.param_spec_array(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecArray.
- Return type:
Creates a new #GimpParamSpecArray specifying a [type`Array`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_brush(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.default_value (
Gimp.Brush
orNone
) – Default brush.default_to_context (
bool
) – Whether the context is the context’s brush.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecBrush.
- Return type:
Creates a new #GimpParamSpecBrush specifying a [type`Brush`] property. See also [func`Gimp`.param_spec_resource].
New in version 3.0.
- Gimp.param_spec_channel(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecChannel.
- Return type:
Creates a new #GimpParamSpecChannel specifying a [type`Channel`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_choice(name, nick, blurb, choice, default_value, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.choice (
Gimp.Choice
) – theGimp.Choice
describing allowed choices.default_value (
str
) –flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecChoice.
- Return type:
Creates a new #GimpParamSpecChoice specifying a
GObject.TYPE_STRING
property. This %GimpParamSpecChoice takes ownership of the reference on choice.See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_choice_get_choice(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a #GimpParamSpecChoice value.- Returns:
the choice object defining the valid values.
- Return type:
New in version 3.0.
- Gimp.param_spec_choice_get_default(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a #GimpParamSpecChoice value.- Returns:
the default value.
- Return type:
New in version 3.0.
- Gimp.param_spec_color(name, nick, blurb, has_alpha, default_color, flags)¶
- Parameters:
name (
str
) – canonical name of the property specifiednick (
str
) – nick name for the property specifiedblurb (
str
) – description of the property specifieddefault_color (
Gegl.Color
) – the default value for the property specifiedflags (
GObject.ParamFlags
) – flags for the property specified
- Returns:
a newly created parameter specification
- Return type:
Creates a new
GObject.ParamSpec
instance specifying aGegl.Color
property. Note that the default_color is duplicated, so reusing object will not change the default color of the returned %GimpParamSpecColor.
- Gimp.param_spec_color_from_string(name, nick, blurb, has_alpha, default_color_string, flags)¶
- Parameters:
name (
str
) – canonical name of the property specifiednick (
str
) – nick name for the property specifiedblurb (
str
) – description of the property specifieddefault_color_string (
str
) – the default value for the property specifiedflags (
GObject.ParamFlags
) – flags for the property specified
- Returns:
a newly created parameter specification
- Return type:
Creates a new
GObject.ParamSpec
instance specifying aGegl.Color
property.
- Gimp.param_spec_color_has_alpha(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold anGegl.Color
value.- Returns:
True
if the alpha channel is relevant.- Return type:
New in version 2.4.
- Gimp.param_spec_config_path(name, nick, blurb, type, default_value, flags)¶
- Parameters:
name (
str
) – Canonical name of the paramnick (
str
) – Nickname of the paramblurb (
str
) – Brief description of param.type (
Gimp.ConfigPathType
) – aGimp.ConfigPathType
value.default_value (
str
) – Value to use if none is assigned.flags (
GObject.ParamFlags
) – a combination ofGObject.ParamFlags
- Returns:
a newly allocated
GObject.ParamSpec
instance- Return type:
Creates a param spec to hold a filename, dir name, or list of file or dir names. See g_param_spec_internal() for more information.
New in version 2.4.
- Gimp.param_spec_config_path_type(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – AGObject.ParamSpec
for a path param- Returns:
a
Gimp.ConfigPathType
value- Return type:
Tells whether the path param encodes a filename, dir name, or list of file or dir names.
New in version 2.4.
- Gimp.param_spec_core_object_array(name, nick, blurb, object_type, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.object_type (
GObject.GType
) –GObject.GType
of the array’s elements.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecCoreObjectArray.
- Return type:
Creates a new #GimpParamSpecCoreObjectArray specifying a [type`CoreObjectArray`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_core_object_array_get_object_type(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a #GimpParamSpecCoreObjectArray value.- Returns:
the type for objects in the object array.
- Return type:
New in version 3.0.
- Gimp.param_spec_display(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecDisplay.
- Return type:
Creates a new #GimpParamSpecDisplay specifying a [type`Display`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_display_none_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a [class`Gimp`.Display] value.- Returns:
- Return type:
New in version 3.0.
- Gimp.param_spec_double_array(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecDoubleArray.
- Return type:
Creates a new #GimpParamSpecDoubleArray specifying a %GIMP_TYPE_DOUBLE_ARRAY property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_drawable(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecDrawable.
- Return type:
Creates a new #GimpParamSpecDrawable specifying a [type`Drawable`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_drawable_filter(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecPath.
- Return type:
Creates a new #GimpParamSpecDrawableFilter specifying a [type`DrawableFilter`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_drawable_filter_none_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a [class`Gimp`.DrawableFilter] value.- Returns:
- Return type:
New in version 3.0.
- Gimp.param_spec_export_options(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecExportOptions.
- Return type:
Creates a new #GimpParamSpecExportOptions specifying a
GObject.TYPE_INT
property.See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_file(name, nick, blurb, action, none_ok, default_value, flags)¶
- Parameters:
name (
str
) – Canonical name of the paramnick (
str
) – Nickname of the paramblurb (
str
) – Brief description of param.action (
Gimp.FileChooserAction
) – The type of file to expect.default_value (
Gio.File
orNone
) – File to use if none is assigned.flags (
GObject.ParamFlags
) – a combination ofGObject.ParamFlags
- Returns:
a newly allocated
GObject.ParamSpec
instance- Return type:
Creates a param spec to hold a file param. See g_param_spec_internal() for more information.
New in version 3.0.
- Gimp.param_spec_file_get_action(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold aGio.File
value.- Returns:
the file action tied to pspec.
- Return type:
New in version 3.0.
- Gimp.param_spec_file_none_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold aGio.File
value.- Returns:
- Return type:
New in version 3.0.
- Gimp.param_spec_file_set_action(pspec, action)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold aGio.File
value.action (
Gimp.FileChooserAction
) – new action for pspec.
Change the file action tied to pspec.
New in version 3.0.
- Gimp.param_spec_font(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.default_to_context (
bool
) – Whether the context is the context’s font.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecFont.
- Return type:
Creates a new #GimpParamSpecFont specifying a [type`Font`] property. See also [func`Gimp`.param_spec_resource].
New in version 3.0.
- Gimp.param_spec_gradient(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.default_value (
Gimp.Gradient
orNone
) – Default gradient.default_to_context (
bool
) – Whether the context is the context’s gradient.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecGradient.
- Return type:
Creates a new #GimpParamSpecGradient specifying a [type`Gradient`] property. See also [func`Gimp`.param_spec_resource].
New in version 3.0.
- Gimp.param_spec_group_layer(name, nick, blurb, none_ok, flags)¶
- Parameters:
- Returns:
The newly created #GimpParamSpecGroupLayer.
- Return type:
Creates a new #GimpParamSpecGroupLayer specifying a [type`GroupLayer`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_image(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecImage.
- Return type:
Creates a new #GimpParamSpecImage specifying a [type`Image`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_image_none_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a [class`Gimp`.Image] value.- Returns:
- Return type:
New in version 3.0.
- Gimp.param_spec_int32_array(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecInt32Array.
- Return type:
Creates a new #GimpParamSpecInt32Array specifying a %GIMP_TYPE_INT32_ARRAY property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_item(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecItem.
- Return type:
Creates a new #GimpParamSpecItem specifying a [type`Item`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_item_none_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a [class`Gimp`.Item] value.- Returns:
- Return type:
New in version 3.0.
- Gimp.param_spec_layer(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecLayer.
- Return type:
Creates a new #GimpParamSpecLayer specifying a [type`Layer`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_layer_mask(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecLayerMask.
- Return type:
Creates a new #GimpParamSpecLayerMask specifying a [type`LayerMask`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_matrix2(name, nick, blurb, default_value, flags)¶
- Parameters:
name (
str
) – Canonical name of the paramnick (
str
) – Nickname of the paramblurb (
str
) – Brief description of param.default_value (
Gimp.Matrix2
) – Value to use if none is assigned.flags (
GObject.ParamFlags
) – a combination ofGObject.ParamFlags
- Returns:
a newly allocated
GObject.ParamSpec
instance- Return type:
Creates a param spec to hold a
Gimp.Matrix2
value. See g_param_spec_internal() for more information.New in version 2.4.
- Gimp.param_spec_matrix3(name, nick, blurb, default_value, flags)¶
- Parameters:
name (
str
) – Canonical name of the paramnick (
str
) – Nickname of the paramblurb (
str
) – Brief description of param.default_value (
Gimp.Matrix3
) – Value to use if none is assigned.flags (
GObject.ParamFlags
) – a combination ofGObject.ParamFlags
- Returns:
a newly allocated
GObject.ParamSpec
instance- Return type:
Creates a param spec to hold a
Gimp.Matrix3
value. See g_param_spec_internal() for more information.New in version 2.8.
- Gimp.param_spec_memsize(name, nick, blurb, minimum, maximum, default_value, flags)¶
- Parameters:
name (
str
) – Canonical name of the paramnick (
str
) – Nickname of the paramblurb (
str
) – Brief description of param.minimum (
int
) – Smallest allowed value of the parameter.maximum (
int
) – Largest allowed value of the parameter.default_value (
int
) – Value to use if none is assigned.flags (
GObject.ParamFlags
) – a combination ofGObject.ParamFlags
- Returns:
a newly allocated
GObject.ParamSpec
instance- Return type:
Creates a param spec to hold a memory size value. See g_param_spec_internal() for more information.
New in version 2.4.
- Gimp.param_spec_object_duplicate(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – a [struct`Gimp`.ParamSpecObject].- Returns:
a newly created param spec.
- Return type:
This function duplicates pspec appropriately, depending on the accurate spec type.
- Gimp.param_spec_object_get_default(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.Object
GObject.ParamSpec
- Returns:
the default value.
- Return type:
Get the default object value of the param spec.
If the pspec has been registered with a specific default (which can be verified with [func`Gimp`.ParamSpecObject.has_default]), it will be returned, though some specific subtypes may support returning dynamic default (e.g. based on context).
- Gimp.param_spec_object_has_default(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.Object
GObject.ParamSpec
- Returns:
whether a default value was set.
- Return type:
This function tells whether a default was set, typically with [func`Gimp`.ParamSpecObject.set_default] or any other way. It does not guarantee that the default is an actual object (it may be
None
if valid as a default).
- Gimp.param_spec_object_set_default(pspec, default_value)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.Object
GObject.ParamSpec
default_value (
GObject.Object
orNone
) – a default value.
Set the default object value of the param spec. This will switch the
has_default
flag so that [func`Gimp`.ParamSpecObject.has_default] will now returnTrue
.A
None
default_value still counts as a default (unless the specific pspec does not allowNone
as a default).
- Gimp.param_spec_palette(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.default_value (
Gimp.Palette
orNone
) – Default palette.default_to_context (
bool
) – Whether the context is the context’s palette.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecPalette.
- Return type:
Creates a new #GimpParamSpecPalette specifying a [type`Palette`] property. See also [func`Gimp`.param_spec_resource].
New in version 3.0.
- Gimp.param_spec_parasite(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecParasite.
- Return type:
Creates a new #GimpParamSpecParasite specifying a [type`Parasite`] property.
See g_param_spec_internal() for details on property names.
New in version 2.4.
- Gimp.param_spec_path(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecPath.
- Return type:
Creates a new #GimpParamSpecPath specifying a [type`Path`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_pattern(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.default_value (
Gimp.Pattern
orNone
) – Default pattern.default_to_context (
bool
) – Whether the context is the context’s pattern.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecPattern.
- Return type:
Creates a new #GimpParamSpecPattern specifying a [type`Pattern`] property. See also [func`Gimp`.param_spec_resource].
New in version 3.0.
- Gimp.param_spec_resource(name, nick, blurb, resource_type, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.resource_type (
GObject.GType
) – aGObject.GType
, subtype of [class`Gimp`.Resource].default_value (
Gimp.Resource
orNone
) – Default resource.default_to_context (
bool
) – Whether the context is the context’s resource for the given resource_type.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecResource.
- Return type:
Creates a new #GimpParamSpecResource specifying a [type`Resource`] property. See [func`GObject`.ParamSpec.internal] for details on property names.
default_to_context cannot be
True
for a resource_type of value [class`Gimp`.Resource], but only for specific subtypes. If it isTrue
, default_value must beNone
. Instead of a fixed default, whatever is the context’s resource for the given type at run time will be used as dynamic default.New in version 3.0.
- Gimp.param_spec_resource_defaults_to_context(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) –- Return type:
- Gimp.param_spec_resource_none_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) –- Return type:
- Gimp.param_spec_selection(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecSelection.
- Return type:
Creates a new #GimpParamSpecSelection specifying a [type`Selection`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_text_layer(name, nick, blurb, none_ok, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.none_ok (
bool
) – Whether no is a valid value.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecTextLayer.
- Return type:
Creates a new #GimpParamSpecTextLayer specifying a [type`TextLayer`] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_unit(name, nick, blurb, allow_pixel, allow_percent, default_value, flags)¶
- Parameters:
name (
str
) – Canonical name of the paramnick (
str
) – Nickname of the paramblurb (
str
) – Brief description of param.allow_pixel (
bool
) – Whether “pixels” is an allowed unit.allow_percent (
bool
) – Whether “percent” is an allowed unit.default_value (
Gimp.Unit
) – Unit to use if none is assigned.flags (
GObject.ParamFlags
) – a combination ofGObject.ParamFlags
- Returns:
a newly allocated
GObject.ParamSpec
instance- Return type:
Creates a param spec to hold a units param. See g_param_spec_internal() for more information.
New in version 2.4.
- Gimp.param_spec_unit_percent_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold anGimp.Unit
value.- Returns:
True
if the [func`Gimp`.Unit.percent] unit is allowed.- Return type:
New in version 3.0.
- Gimp.param_spec_unit_pixel_allowed(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold anGimp.Unit
value.- Returns:
True
if the [func`Gimp`.Unit.pixel] unit is allowed.- Return type:
New in version 3.0.
- Gimp.param_spec_value_array(name, nick, blurb, element_spec, flags)¶
- Parameters:
name (
str
) – Canonical name of the property specified.nick (
str
) – Nick name of the property specified.blurb (
str
) – Description of the property specified.element_spec (
GObject.ParamSpec
orNone
) –GObject.ParamSpec
the contained array’s elements have comply to, orNone
.flags (
GObject.ParamFlags
) – Flags for the property specified.
- Returns:
The newly created #GimpParamSpecValueArray.
- Return type:
Creates a new #GimpParamSpecValueArray specifying a [type`GObject`.ValueArray] property.
See g_param_spec_internal() for details on property names.
New in version 3.0.
- Gimp.param_spec_value_array_get_element_spec(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec
) – aGObject.ParamSpec
to hold a #GimpParamSpecValueArray value.- Returns:
param spec for elements of the value array.
- Return type:
New in version 3.0.
- Gimp.patterns_close_popup(pattern_callback)¶
- Parameters:
pattern_callback (
str
) – The name of the callback registered for this pop-up.- Returns:
True
on success.- Return type:
Close the pattern selection dialog.
Closes an open pattern selection dialog.
- Gimp.patterns_get_list(filter)¶
- Parameters:
filter (
str
orNone
) – An optional regular expression used to filter the list.- Returns:
The list of patterns. The returned value must be freed with
GLib.free
().- Return type:
Retrieve a complete listing of the available patterns.
This procedure returns a complete listing of available GIMP patterns. Each pattern returned can be used as input to [func`Gimp`.context_set_pattern].
- Gimp.patterns_popup(pattern_callback, popup_title, initial_pattern, parent_window)¶
- Parameters:
pattern_callback (
str
) – The callback PDB proc to call when the user chooses a pattern.popup_title (
str
) – Title of the pattern selection dialog.initial_pattern (
Gimp.Pattern
orNone
) – The pattern to set as the initial choice.parent_window (
GLib.Bytes
orNone
) – An optional parent window handle for the popup to be set transient to.
- Returns:
True
on success.- Return type:
Invokes the Gimp pattern selection.
Opens the pattern selection dialog.
- Gimp.patterns_refresh()¶
-
Refresh current patterns. This function always succeeds.
This procedure retrieves all patterns currently in the user’s pattern path and updates all pattern dialogs accordingly.
- Gimp.patterns_set_popup(pattern_callback, pattern)¶
- Parameters:
pattern_callback (
str
) – The name of the callback registered for this pop-up.pattern (
Gimp.Pattern
) – The pattern to set as selected.
- Returns:
True
on success.- Return type:
Sets the current pattern in a pattern selection dialog.
Sets the current pattern in a pattern selection dialog.
- Gimp.pencil(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Paint in the current brush without sub-pixel sampling.
This tool is the standard pencil. It draws linearly interpolated lines through the specified stroke coordinates. It operates on the specified drawable in the foreground color with the active brush. The brush mask is treated as though it contains only black and white values. Any value below half is treated as black; any above half, as white.
- Gimp.pixbuf_create_buffer(pixbuf)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf
) – aGdkPixbuf.Pixbuf
- Returns:
a new
Gegl.Buffer
.- Return type:
Returns a
Gegl.Buffer
that’s either backed by the pixbuf's pixels, or a copy of them. This function tries to not copy the pixbuf's pixels. If the pixbuf’s rowstride is a multiple of its bpp, a simple reference to the pixbuf's pixels is made and pixbuf will be kept around for as long as the buffer exists; otherwise the pixels are copied.New in version 2.10.
- Gimp.pixbuf_get_format(pixbuf)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf
) – aGdkPixbuf.Pixbuf
- Returns:
the pixbuf's pixel format
- Return type:
Returns the
Babl.Object
format that corresponds to the pixbuf's pixel format.New in version 2.10.
- Gimp.pixbuf_get_icc_profile(pixbuf)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf
) – aGdkPixbuf.Pixbuf
- Returns:
The ICC profile data, or
None
. The value should be freed withGLib.free
().- Return type:
Returns the ICC profile attached to the pixbuf, or
None
if there is none.New in version 2.10.
- Gimp.pixels_to_units(pixels, unit, resolution)¶
- Parameters:
- Returns:
pixels converted to units.
- Return type:
Converts a value specified in pixels to unit.
New in version 2.8.
- Gimp.pixpipe_params_build(params)¶
- Parameters:
params (
Gimp.PixPipeParams
) –- Return type:
- Gimp.pixpipe_params_free(params)¶
- Parameters:
params (
Gimp.PixPipeParams
) –
- Gimp.pixpipe_params_init(params)¶
- Parameters:
params (
Gimp.PixPipeParams
) –
- Gimp.pixpipe_params_parse(parameters, params)¶
- Parameters:
parameters (
str
) –params (
Gimp.PixPipeParams
) –
- Gimp.progress_cancel(progress_callback)¶
- Parameters:
progress_callback (
str
) – The name of the callback registered for this progress.- Returns:
True
on success.- Return type:
Cancels a running progress.
This function cancels the currently running progress.
New in version 2.2.
- Gimp.progress_end()¶
-
Ends the progress bar for the current plug-in.
Ends the progress display for the current plug-in. Most plug-ins don’t need to call this, they just exit when the work is done. It is only valid to call this procedure from a plug-in.
New in version 2.4.
- Gimp.progress_get_window_handle()¶
- Returns:
The progress bar’s toplevel window’s handle.
- Return type:
Returns the native handle of the toplevel window this plug-in’s progress is or would be displayed in.
This function returns the native handle allowing to identify the toplevel window this plug-in’s progress is displayed in. It should still work even if the progress bar has not been initialized yet, unless the plug-in wasn’t called from a GUI. This handle can be of various types (integer, string, etc.) depending on the platform you are running on which is why it returns a
GLib.Bytes
. There are usually no reasons to call this directly.New in version 2.2.
- Gimp.progress_init(message)¶
- Parameters:
message (
str
) – Message to use in the progress dialog.- Returns:
True
on success.- Return type:
Initializes the progress bar for the current plug-in.
Initializes the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.
- Gimp.progress_install_vtable(vtable, user_data, user_data_destroy)¶
- Parameters:
vtable (
Gimp.ProgressVtable
) – a pointer to a GimpProgressVtable.user_data (
object
orNone
) – a pointer that is passed as user_data to all vtable functions.user_data_destroy (
GLib.DestroyNotify
orNone
) – destroy function for user_data, orNone
.
- Returns:
the name of the temporary procedure that’s been installed
- Return type:
New in version 2.4.
- Gimp.progress_pulse()¶
-
Pulses the progress bar for the current plug-in.
Updates the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in. Use this function instead of
Gimp.progress_update
() if you cannot tell how much progress has been made. This usually causes the the progress bar to enter \”activity mode\”, where a block bounces back and forth.New in version 2.4.
- Gimp.progress_set_text(message)¶
- Parameters:
message (
str
orNone
) – Message to use in the progress dialog.- Returns:
True
on success.- Return type:
Changes the text in the progress bar for the current plug-in.
This function changes the text in the progress bar for the current plug-in. Unlike
Gimp.progress_init
() it does not change the displayed value.New in version 2.4.
- Gimp.progress_uninstall(progress_callback)¶
- Parameters:
progress_callback (
str
) – the name of the temporary procedure to uninstall
Uninstalls a temporary progress procedure that was installed using gimp_progress_install().
New in version 2.2.
- Gimp.progress_update(percentage)¶
- Parameters:
percentage (
float
) – Percentage of progress completed (in the range from 0.0 to 1.0).- Returns:
True
on success.- Return type:
Updates the progress bar for the current plug-in.
The library will handle over-updating by possibly dropping silently some updates when they happen too close next to each other (either time-wise or step-wise). The caller does not have to take care of this aspect of progression and can focus on computing relevant progression steps.
- Gimp.quit()¶
Forcefully causes the GIMP library to exit and close down its connection to main gimp application. This function never returns.
- Gimp.range_estimate_settings(lower, upper)¶
- Parameters:
- Returns:
- step:
the proposed step increment.
- page:
the proposed page increment.
- digits:
the proposed decimal places precision.
- Return type:
This function proposes reasonable settings for increments and display digits. These can be used for instance on #GtkRange or other widgets using a #GtkAdjustment typically. Note that it will never return digits with value 0. If you know that your input needs to display integer values, there is no need to set digits.
There is no universal answer to the best increments and number of decimal places. It often depends on context of what the value is meant to represent. This function only tries to provide sensible generic values which can be used when it doesn’t matter too much or for generated GUI for instance. If you know exactly how you want to show and interact with a given range, you don’t have to use this function.
- Gimp.rectangle_intersect(x1, y1, width1, height1, x2, y2, width2, height2)¶
- Parameters:
x1 (
int
) – origin of first rectangley1 (
int
) – origin of first rectanglewidth1 (
int
) – width of first rectangleheight1 (
int
) – height of first rectanglex2 (
int
) – origin of second rectangley2 (
int
) – origin of second rectanglewidth2 (
int
) – width of second rectangleheight2 (
int
) – height of second rectangle
- Returns:
- Return type:
(
bool
, dest_x:int
, dest_y:int
, dest_width:int
, dest_height:int
)
Calculates the intersection of two rectangles.
New in version 2.4.
- Gimp.rectangle_union(x1, y1, width1, height1, x2, y2, width2, height2)¶
- Parameters:
x1 (
int
) – origin of first rectangley1 (
int
) – origin of first rectanglewidth1 (
int
) – width of first rectangleheight1 (
int
) – height of first rectanglex2 (
int
) – origin of second rectangley2 (
int
) – origin of second rectanglewidth2 (
int
) – width of second rectangleheight2 (
int
) – height of second rectangle
- Returns:
- Return type:
(dest_x:
int
, dest_y:int
, dest_width:int
, dest_height:int
)
Calculates the union of two rectangles.
New in version 2.8.
- Gimp.show_help_button()¶
- Returns:
the show_help_button boolean
- Return type:
Returns whether or not GimpDialog should automatically add a help button if help_func and help_id are given.
This is a constant value given at plug-in configuration time.
New in version 2.2.
- Gimp.smudge(drawable, pressure, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.pressure (
float
) – The pressure of the smudge strokes.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Smudge image with varying pressure.
This tool simulates a smudge using the current brush. High pressure results in a greater smudge of paint while low pressure results in a lesser smudge.
- Gimp.smudge_default(drawable, strokes)¶
- Parameters:
drawable (
Gimp.Drawable
) – The affected drawable.strokes ([
float
]) – Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, …, sn.x, sn.y }.
- Returns:
True
on success.- Return type:
Smudge image with varying pressure.
This tool simulates a smudge using the current brush. It behaves exactly the same as
Gimp.smudge
() except that the pressure value is taken from the smudge tool options or the options default if the tools option dialog has not been activated.
- Gimp.stack_trace_available(optimal)¶
-
Returns
True
if we have dependencies to generate backtraces. If optimal isTrue
, the function will returnTrue
only when we are able to generate optimal traces (i.e. with GDB or LLDB); otherwise we returnTrue
even if only backtrace() API is available.On Win32, we return
True
if Dr. Mingw is built-in,False
otherwise.Note: this function is not crash-safe, i.e. you should not try to use it in a callback when the program is already crashing. In such a case, call
Gimp.stack_trace_print
() orGimp.stack_trace_query
() directly.New in version 2.10.
- Gimp.stack_trace_print(prog_name, stream)¶
- Parameters:
- Returns:
True
if a stack trace could be generated,False
otherwise.- trace:
location to store a newly allocated string of the trace.
- Return type:
Attempts to generate a stack trace at current code position in prog_name. prog_name is mostly a helper and can be set to
None
. Nevertheless if set, it has to be the current program name (argv[0]). This function is not meant to generate stack trace for third-party programs, and will attach the current process id only. Internally, this function usesgdb
orlldb
if they are available, or the stacktrace() API on platforms where it is available. It always fails on Win32.The stack trace, once generated, will either be printed to stream or returned as a newly allocated string in trace, if not
None
.In some error cases (e.g. segmentation fault), trying to allocate more memory will trigger more segmentation faults and therefore loop our error handling (which is just wrong). Therefore printing to a file description is an implementation without any memory allocation.
New in version 2.10.
- Gimp.stack_trace_query(prog_name)¶
- Parameters:
prog_name (
str
) – the program to attach to.
This is mostly the same as
GLib.on_error_query
() except that we use our own backtrace function, much more complete. prog_name must be the current program name (argv[0]). It does nothing on Win32.New in version 2.10.
- Gimp.strip_uline(str)¶
- Parameters:
- Returns:
A (possibly stripped) copy of str which should be freed using
GLib.free
() when it is not needed any longer.- Return type:
This function returns a copy of str stripped of underline characters. This comes in handy when needing to strip mnemonics from menu paths etc.
In some languages, mnemonics are handled by adding the mnemonic character in brackets (like “File (_F)”). This function recognizes this construct and removes the whole bracket construction to get rid of the mnemonic (see bug 157561).
- Gimp.sysconf_directory()¶
- Returns:
The top directory for GIMP config files.
- Return type:
Returns the top directory for GIMP config files. If the environment variable GIMP3_SYSCONFDIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Windows, the installation directory as deduced from the executable’s full filename is used.
In config files such as gimprc, the string ${gimp_sysconf_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn’t necessarily UTF-8. (On Windows it always is UTF-8.).
- Gimp.temp_directory()¶
- Returns:
The default top directory for GIMP temporary files.
- Return type:
Returns the default top directory for GIMP temporary files. If the environment variable GIMP3_TEMPDIR exists, that is used. It should be an absolute pathname. Otherwise, a subdirectory of the directory returned by
GLib.get_tmp_dir
() is used.In config files such as gimprc, the string ${gimp_temp_dir} expands to this directory.
Note that the actual directories used for GIMP temporary files can be overridden by the user in the preferences dialog.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn’t necessarily UTF-8. (On Windows it always is UTF-8.).
New in version 2.10.10.
- Gimp.temp_file(extension)¶
- Parameters:
- Returns:
The new temp file.
- Return type:
Generates a unique temporary file.
Generates a unique file using the temp path supplied in the user’s gimprc.
- Gimp.text_font(image, drawable, x, y, text, border, antialias, size, font)¶
- Parameters:
image (
Gimp.Image
) – The image.drawable (
Gimp.Drawable
orNone
) – The affected drawable: (None
for a new text layer).x (
float
) – The x coordinate for the left of the text bounding box.y (
float
) – The y coordinate for the top of the text bounding box.text (
str
) – The text to generate (in UTF-8 encoding).border (
int
) – The size of the border.antialias (
bool
) – Antialiasing.size (
float
) – The size of text in pixels.font (
Gimp.Font
) – The font.
- Returns:
The new text layer or
None
if no layer was created.- Return type:
Gimp.Layer
orNone
Add text at the specified location as a floating selection or a new layer.
The x and y parameters together control the placement of the new text by specifying the upper left corner of the text bounding box. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (
None
), the text will appear as a new layer. Finally, a border can be specified around the final rendered text. The border is measured in pixels. The size is always in pixels. If you need to display a font in points, divide the size in points by 72.0 and multiply it by the image’s vertical resolution.
- Gimp.text_get_extents_font(text, size, font)¶
- Parameters:
- Returns:
True
on success.- width:
The width of the glyph extents.
- height:
The height of the glyph extents.
- ascent:
The ascent of the glyph extents.
- descent:
The descent of the glyph extents.
- Return type:
Get extents of the bounding box for the specified text.
This tool returns the width and height of a bounding box for the specified text rendered with the specified font information. Ascent and descent of the glyph extents are returned as well. The ascent is the distance from the baseline to the highest point of the character. This is positive if the glyph ascends above the baseline. The descent is the distance from the baseline to the lowest point of the character. This is positive if the glyph descends below the baseline. The size is always in pixels. If you need to set a font in points, divide the size in points by 72.0 and multiply it by the vertical resolution of the image you are taking into account.
- Gimp.tile_height()¶
- Returns:
the tile_height
- Return type:
Returns the tile height GIMP is using.
This is a constant value given at plug-in configuration time.
- Gimp.tile_width()¶
- Returns:
the tile_width
- Return type:
Returns the tile width GIMP is using.
This is a constant value given at plug-in configuration time.
- Gimp.type_get_translation_context(type)¶
- Parameters:
type (
GObject.GType
) – aGObject.GType
- Returns:
the translation context associated with type or
None
if no context was set- Return type:
Retrieves the translation context that has been previously set using
Gimp.type_set_translation_context
(). You should not need to use this function directly, useGimp.enum_get_value
() orGimp.enum_value_get_desc
() instead.New in version 2.8.
- Gimp.type_get_translation_domain(type)¶
- Parameters:
type (
GObject.GType
) – aGObject.GType
- Returns:
the translation domain associated with type or
None
if no domain was set- Return type:
Retrieves the gettext translation domain identifier that has been previously set using
Gimp.type_set_translation_domain
(). You should not need to use this function directly, useGimp.enum_get_value
() orGimp.enum_value_get_desc
() instead.New in version 2.2.
- Gimp.type_set_translation_context(type, context)¶
- Parameters:
type (
GObject.GType
) – aGObject.GType
context (
str
) – a constant string that identifies a translation context orNone
This function attaches a constant string as a translation context to a
GObject.GType
. The only purpose of this function is to use it when registering aGObject.TYPE_ENUM
with translatable value names.New in version 2.8.
- Gimp.type_set_translation_domain(type, domain)¶
- Parameters:
type (
GObject.GType
) – aGObject.GType
domain (
str
) – a constant string that identifies a translation domain orNone
This function attaches a constant string as a gettext translation domain identifier to a
GObject.GType
. The only purpose of this function is to use it when registering aGObject.TYPE_ENUM
with translatable value names.New in version 2.2.
- Gimp.units_to_pixels(value, unit, resolution)¶
- Parameters:
- Returns:
value converted to pixels.
- Return type:
Converts a value specified in unit to pixels.
New in version 2.8.
- Gimp.units_to_points(value, unit, resolution)¶
- Parameters:
- Returns:
value converted to points.
- Return type:
Converts a value specified in unit to points.
New in version 2.8.
- Gimp.user_time()¶
- Returns:
timestamp for plug-in window
- Return type:
Returns the timestamp of the user interaction that should be set on the plug-in window. This is handled transparently, plug-in authors do not have to care about it.
This is a constant value given at plug-in configuration time.
New in version 2.6.
- Gimp.utf8_strtrim(str, max_chars)¶
- Parameters:
- Returns:
A (possibly trimmed) copy of str which should be freed using
GLib.free
() when it is not needed any longer.- Return type:
Creates a (possibly trimmed) copy of str. The string is cut if it exceeds max_chars characters or on the first newline. The fact that the string was trimmed is indicated by appending an ellipsis.
- Gimp.value_dup_double_array(value)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_DOUBLE_ARRAY- Returns:
The contents of value
- Return type:
[
float
]
Gets the contents of a %GIMP_TYPE_DOUBLE_ARRAY
GObject.Value
- Gimp.value_dup_int32_array(value)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_INT32_ARRAY- Returns:
The contents of value
- Return type:
[
int
]
Gets the contents of a %GIMP_TYPE_INT32_ARRAY
GObject.Value
- Gimp.value_get_double_array(value)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_DOUBLE_ARRAY- Returns:
The contents of value
- Return type:
[
float
]
Gets the contents of a %GIMP_TYPE_DOUBLE_ARRAY
GObject.Value
- Gimp.value_get_int32_array(value)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_INT32_ARRAY- Returns:
The contents of value
- Return type:
[
int
]
Gets the contents of a %GIMP_TYPE_INT32_ARRAY
GObject.Value
- Gimp.value_set_double_array(value, data)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_DOUBLE_ARRAY
Sets the contents of value to data.
- Gimp.value_set_int32_array(value, data)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_INT32_ARRAYdata ([
int
]) – A #gint32 array
Sets the contents of value to data.
- Gimp.value_set_static_double_array(value, data)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_DOUBLE_ARRAY
Sets the contents of value to data, without copying the data.
- Gimp.value_set_static_int32_array(value, data)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_INT32_ARRAYdata ([
int
]) – A #gint32 array
Sets the contents of value to data, without copying the data.
- Gimp.value_take_double_array(value, data)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_DOUBLE_ARRAY
Sets the contents of value to data, and takes ownership of data.
- Gimp.value_take_int32_array(value, data)¶
- Parameters:
value (
GObject.Value
) – A valid value of type %GIMP_TYPE_int32_ARRAYdata ([
int
]) – A #gint32 array
Sets the contents of value to data, and takes ownership of data.
- Gimp.vector2_add(vector1, vector2)¶
- Parameters:
vector1 (
Gimp.Vector2
) – a pointer to the firstGimp.Vector2
.vector2 (
Gimp.Vector2
) – a pointer to the secondGimp.Vector2
.
- Returns:
destination for the resulting
Gimp.Vector2
.- Return type:
result:
Gimp.Vector2
Computes the sum of two 2D vectors. The resulting
Gimp.Vector2
is stored in result.
- Gimp.vector2_sub(vector1, vector2)¶
- Parameters:
vector1 (
Gimp.Vector2
) – a pointer to the firstGimp.Vector2
.vector2 (
Gimp.Vector2
) – a pointer to the secondGimp.Vector2
.
- Returns:
the destination for the resulting
Gimp.Vector2
.- Return type:
result:
Gimp.Vector2
Computes the difference of two 2D vectors (vector1 minus vector2). The resulting
Gimp.Vector2
is stored in result.
- Gimp.vector3_add(vector1, vector2)¶
- Parameters:
vector1 (
Gimp.Vector3
) – a pointer to the firstGimp.Vector3
.vector2 (
Gimp.Vector3
) – a pointer to the secondGimp.Vector3
.
- Returns:
destination for the resulting
Gimp.Vector3
.- Return type:
result:
Gimp.Vector3
Computes the sum of two 3D vectors. The resulting
Gimp.Vector3
is stored in result.
- Gimp.vector3_sub(vector1, vector2)¶
- Parameters:
vector1 (
Gimp.Vector3
) – a pointer to the firstGimp.Vector3
.vector2 (
Gimp.Vector3
) – a pointer to the secondGimp.Vector3
.
- Returns:
the destination for the resulting
Gimp.Vector3
.- Return type:
result:
Gimp.Vector3
Computes the difference of two 3D vectors (vector1 minus vector2). The resulting
Gimp.Vector3
is stored in result.
- Gimp.vector_2d_to_3d(sx, sy, w, h, x, y, vp, p)¶
- Parameters:
sx (
int
) – the abscissa of the upper-left screen rectangle.sy (
int
) – the ordinate of the upper-left screen rectangle.w (
int
) – the width of the screen rectangle.h (
int
) – the height of the screen rectangle.x (
int
) – the abscissa of the point in the screen rectangle to map.y (
int
) – the ordinate of the point in the screen rectangle to map.vp (
Gimp.Vector3
) – the position of the observer.p (
Gimp.Vector3
) – the resulting point.
\”Compute screen (sx, sy) - (sx + w, sy + h) to 3D unit square mapping. The plane to map to is given in the z field of p. The observer is located at position vp (vp->z != 0.0).\”
In other words, this computes the projection of the point (x, y) to the plane z = p->z (parallel to XY), from the vp point of view through the screen (sx, sy)->(sx + w, sy + h)
- Gimp.vector_2d_to_3d_val(sx, sy, w, h, x, y, vp, p)¶
- Parameters:
sx (
int
) – the abscissa of the upper-left screen rectangle.sy (
int
) – the ordinate of the upper-left screen rectangle.w (
int
) – the width of the screen rectangle.h (
int
) – the height of the screen rectangle.x (
int
) – the abscissa of the point in the screen rectangle to map.y (
int
) – the ordinate of the point in the screen rectangle to map.vp (
Gimp.Vector3
) – position of the observer.p (
Gimp.Vector3
) – the resulting point.
- Returns:
the computed
Gimp.Vector3
point.- Return type:
This function is identical to
Gimp.vector_2d_to_3d
() but the position of the observer and the resulting point p are passed by value rather than by reference.
- Gimp.vector_3d_to_2d(sx, sy, w, h, vp, p)¶
- Parameters:
sx (
int
) – the abscissa of the upper-left screen rectangle.sy (
int
) – the ordinate of the upper-left screen rectangle.w (
int
) – the width of the screen rectangle.h (
int
) – the height of the screen rectangle.vp (
Gimp.Vector3
) – position of the observer.p (
Gimp.Vector3
) – the 3D point to project to the plane.
- Returns:
- x:
the abscissa of the point in the screen rectangle to map.
- y:
the ordinate of the point in the screen rectangle to map.
- Return type:
Convert the given 3D point to 2D (project it onto the viewing plane, (sx, sy, 0) - (sx + w, sy + h, 0). The input is assumed to be in the unit square (0, 0, z) - (1, 1, z). The viewpoint of the observer is passed in vp.
This is basically the opposite of
Gimp.vector_2d_to_3d
().
- Gimp.version()¶
-
Returns the host GIMP version.
This procedure returns the version number of the currently running GIMP.