gimp_image_new ()

Creates a new image, undisplayed with the specified extents and
type. A layer should be created and added before this image is
displayed, or subsequent calls to gimp_display_new() with this image
as an argument will fail. Layers can be created using the
gimp_layer_new() commands. They can be added to an image using the
gimp_image_insert_layer() command.

width :

The width of the image.

height :

The height of the image.

type :

The type of image.

Returns :

The ID of the newly created image.

gimp_image_get_uri ()

returns NULL. See also gimp-image-get-imported-uri to get the URI
of the current file if it was imported from a non-GIMP file format
and not yet saved, or gimp-image-get-exported-uri if the image has
been exported to a non-GIMP file format.

gimp_image_get_imported_uri ()

This procedure returns the URI associated with the specified image
if the image was imported from a non-native Gimp format. If the
image was not imported, or has since been saved in the native Gimp
format, this procedure returns NULL.

image_ID :

The image.

Returns :

The imported URI.

Since GIMP 2.8

gimp_image_duplicate ()

gint32 gimp_image_duplicate (gint32 image_ID);

Duplicate the specified image

This procedure duplicates the specified image, copying all layers,
channels, and image information.

image_ID :

The image.

Returns :

The new, duplicated image.

gimp_image_delete ()

If there are no displays associated with this image it will be
deleted. This means that you can not delete an image through the PDB
that was created by the user. If the associated display was however
created through the PDB and you know the display ID, you may delete
the display. Removal of the last associated display will then delete
the image.

gimp_image_resize ()

This procedure resizes the image so that it's new width and height
are equal to the supplied parameters. Offsets are also provided
which describe the position of the previous image's content. All
channels within the image are resized according to the specified
parameters; this includes the image selection mask. All layers
within the image are repositioned according to the specified
offsets.

image_ID :

The image.

new_width :

New image width.

new_height :

New image height.

offx :

x offset between upper left corner of old and new images: (new - old).

offy :

y offset between upper left corner of old and new images: (new - old).

Returns :

TRUE on success.

gimp_image_resize_to_layers ()

This procedure resizes the image to the bounding box of all layers
of the image. All channels within the image are resized to the new
size; this includes the image selection mask. All layers within the
image are repositioned to the new image area.

image_ID :

The image.

Returns :

TRUE on success.

Since GIMP 2.2

gimp_image_scale ()

This procedure scales the image so that its new width and height are
equal to the supplied parameters. All layers and channels within the
image are scaled according to the specified parameters; this
includes the image selection mask. The interpolation method used can
be set with gimp_context_set_interpolation().

gimp_image_crop ()

This procedure crops the image so that it's new width and height are
equal to the supplied parameters. Offsets are also provided which
describe the position of the previous image's content. All channels
and layers within the image are cropped to the new image extents;
this includes the image selection mask. If any parameters are out of
range, an error is returned.

gimp_image_get_channels ()

This procedure returns the list of channels contained in the
specified image. This does not include the selection mask, or layer
masks. The order is from topmost to bottommost.

image_ID :

The image.

num_channels :

The number of channels contained in the image.

Returns :

The list of channels contained in the image.

gimp_image_get_active_drawable ()

gint32 gimp_image_get_active_drawable (gint32 image_ID);

Get the image's active drawable

This procedure returns the ID of the image's active drawable. This
can be either a layer, a channel, or a layer mask. The active
drawable is specified by the active image channel. If that is -1,
then by the active image layer. If the active image layer has a
layer mask and the layer mask is in edit mode, then the layer mask
is the active drawable.

image_ID :

The image.

Returns :

The active drawable.

gimp_image_get_floating_sel ()

gint32 gimp_image_get_floating_sel (gint32 image_ID);

Return the floating selection of the image.

This procedure returns the image's floating selection, if it exists.
If it doesn't exist, -1 is returned as the layer ID.

image_ID :

The image.

Returns :

The image's floating selection.

gimp_image_floating_sel_attached_to ()

gint32 gimp_image_floating_sel_attached_to (gint32 image_ID);

Return the drawable the floating selection is attached to.

This procedure returns the drawable the image's floating selection
is attached to, if it exists. If it doesn't exist, -1 is returned as
the drawable ID.

This tool determines the color at the specified coordinates. The
returned color is an RGB triplet even for grayscale and indexed
drawables. If the coordinates lie outside of the extents of the
specified drawable, then an error is returned. If the drawable has
an alpha channel, the algorithm examines the alpha value of the
drawable at the coordinates. If the alpha value is completely
transparent (0), then an error is returned. If the sample_merged
parameter is TRUE, the data of the composite image will be used
instead of that for the specified drawable. This is equivalent to
sampling for colors after merging all visible layers. In the case of
a merged sampling, the supplied drawable is ignored.

image_ID :

The image.

drawable_ID :

The drawable to pick from.

x :

x coordinate of upper-left corner of rectangle.

y :

y coordinate of upper-left corner of rectangle.

sample_merged :

Use the composite image, not the drawable.

sample_average :

Average the color of all the pixels in a specified radius.

average_radius :

The radius of pixels to average.

color :

The return color.

Returns :

TRUE on success.

gimp_image_pick_correlate_layer ()

This procedure finds the layer which is visible at the specified
coordinates. Layers which do not qualify are those whose extents do
not pass within the specified coordinates, or which are transparent
at the specified coordinates. This procedure will return -1 if no
layer is found.

image_ID :

The image.

x :

The x coordinate for the pick.

y :

The y coordinate for the pick.

Returns :

The layer found at the specified coordinates.

gimp_image_get_item_position ()

This procedure determines the position of the specified item in its
level in its item tree in the image. If the item doesn't exist in
the image, or the item is not part of an item tree, an error is
returned.

gimp_image_insert_layer ()

This procedure adds the specified layer to the image at the given
position. If the specified parent is a valid layer group (See
gimp_item_is_group() and gimp_layer_group_new()) then the layer is
added inside the group. If the parent is 0, the layer is added
inside the main stack, outside of any group. The position argument
specifies the location of the layer inside the stack (or the group,
if a valid parent was supplied), starting from the top (0) and
increasing. If the position is specified as -1 and the parent is
specified as 0, then the layer is inserted above the active layer,
or inside the group if the active layer is a layer group. The layer
type must be compatible with the image base type.

image_ID :

The image.

layer_ID :

The layer.

parent_ID :

The parent layer.

position :

The layer position.

Returns :

TRUE on success.

gimp_image_remove_layer ()

This procedure removes the specified layer from the image. If the
layer doesn't exist, an error is returned. If there are no layers
left in the image, this call will fail. If this layer is the last
layer remaining, the image will become empty and have no active
layer.

gimp_image_insert_channel ()

This procedure adds the specified channel to the image at the given
position. Since channel groups are not currently supported, the
parent argument must always be 0. The position argument specifies
the location of the channel inside the stack, starting from the top
(0) and increasing. If the position is specified as -1, then the
channel is inserted above the active channel.

gimp_image_flatten ()

gint32 gimp_image_flatten (gint32 image_ID);

Flatten all visible layers into a single layer. Discard all
invisible layers.

This procedure combines the visible layers in a manner analogous to
merging with the CLIP_TO_IMAGE merge type. Non-visible layers are
discarded, and the resulting image is stripped of its alpha channel.

image_ID :

The image.

Returns :

The resulting layer.

gimp_image_merge_visible_layers ()

This procedure combines the visible layers into a single layer using
the specified merge type. A merge type of EXPAND_AS_NECESSARY
expands the final layer to encompass the areas of the visible
layers. A merge type of CLIP_TO_IMAGE clips the final layer to the
extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the
final layer to the size of the bottommost layer.

image_ID :

The image.

merge_type :

The type of merge.

Returns :

The resulting layer.

gimp_image_merge_down ()

This procedure combines the passed layer and the first visible layer
below it using the specified merge type. A merge type of
EXPAND_AS_NECESSARY expands the final layer to encompass the areas
of the visible layers. A merge type of CLIP_TO_IMAGE clips the final
layer to the extents of the image. A merge type of
CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the
bottommost layer.

image_ID :

The image.

merge_layer_ID :

The layer to merge down from.

merge_type :

The type of merge.

Returns :

The resulting layer.

gimp_image_clean_all ()

This procedure sets the specified image's dirty count to 0, allowing
operations to occur without having a 'dirtied' image. This is
especially useful for creating and loading images which should not
initially be considered dirty, even though layers must be created,
filled, and installed in the image. Note that save plug-ins must NOT
call this function themselves after saving the image.

image_ID :

The image.

Returns :

TRUE on success.

gimp_image_is_dirty ()

This procedure checks the specified image's dirty count to see if it
needs to be saved. Note that saving the image does not automatically
set the dirty count to 0, you need to call gimp_image_clean_all()
after calling a save procedure to make the image clean.

image_ID :

The image.

Returns :

TRUE if the image has unsaved changes.

gimp_image_get_active_layer ()

gint32 gimp_image_get_active_layer (gint32 image_ID);

Returns the specified image's active layer.

If there is an active layer, its ID will be returned, otherwise, -1.
If a channel is currently active, then no layer will be. If a layer
mask is active, then this will return the associated layer.

image_ID :

The image.

Returns :

The active layer.

gimp_image_set_active_layer ()

If the layer exists, it is set as the active layer in the image. Any
previous active layer or channel is set to inactive. An exception is
a previously existing floating selection, in which case this
procedure will return an execution error.

image_ID :

The image.

active_layer_ID :

The new image active layer.

Returns :

TRUE on success.

gimp_image_get_active_channel ()

gint32 gimp_image_get_active_channel (gint32 image_ID);

Returns the specified image's active channel.

If there is an active channel, this will return the channel ID,
otherwise, -1.

image_ID :

The image.

Returns :

The active channel.

gimp_image_set_active_channel ()

If the channel exists, it is set as the active channel in the image.
Any previous active channel or channel is set to inactive. An
exception is a previously existing floating selection, in which case
this procedure will return an execution error.

image_ID :

The image.

active_channel_ID :

The new image active channel.

Returns :

TRUE on success.

gimp_image_unset_active_channel ()

If an active channel exists, it is unset. There then exists no
active channel, and if desired, one can be set through a call to
'Set Active Channel'. No error is returned in the case of no
existing active channel.

image_ID :

The image.

Returns :

TRUE on success.

gimp_image_get_selection ()

gint32 gimp_image_get_selection (gint32 image_ID);

Returns the specified image's selection.

This will always return a valid ID for a selection -- which is
represented as a channel internally.

image_ID :

The image.

Returns :

The selection channel.

gimp_image_get_component_active ()

This procedure returns if the specified image's image component
(i.e. Red, Green, Blue intensity channels in an RGB image) is active
or inactive -- whether or not it can be modified. If the specified
component is not valid for the image type, an error is returned.

image_ID :

The image.

component :

The image component.

Returns :

Component is active.

gimp_image_set_component_active ()

This procedure sets if the specified image's image component (i.e.
Red, Green, Blue intensity channels in an RGB image) is active or
inactive -- whether or not it can be modified. If the specified
component is not valid for the image type, an error is returned.

image_ID :

The image.

component :

The image component.

active :

Component is active.

Returns :

TRUE on success.

gimp_image_get_component_visible ()

This procedure returns if the specified image's image component
(i.e. Red, Green, Blue intensity channels in an RGB image) is
visible or invisible -- whether or not it can be seen. If the
specified component is not valid for the image type, an error is
returned.

image_ID :

The image.

component :

The image component.

Returns :

Component is visible.

gimp_image_set_component_visible ()

This procedure sets if the specified image's image component (i.e.
Red, Green, Blue intensity channels in an RGB image) is visible or
invisible -- whether or not it can be seen. If the specified
component is not valid for the image type, an error is returned.

image_ID :

The image.

component :

The image component.

visible :

Component is visible.

Returns :

TRUE on success.

gimp_image_get_filename ()

This procedure returns the specified image's filename in the
filesystem encoding. The image has a filename only if it was loaded
or imported from a file or has since been saved or exported.
Otherwise, this function returns NULL. See also
gimp_image_get_uri().

gimp_image_get_unit ()

This procedure returns the specified image's unit. This value is
independent of any of the layers in this image. See the
gimp_unit_*() procedure definitions for the valid range of unit IDs
and a description of the unit system.

image_ID :

The image.

Returns :

The unit.

gimp_image_set_unit ()

This procedure sets the specified image's unit. No scaling or
resizing is performed. This value is independent of any of the
layers in this image. See the gimp_unit_*() procedure definitions
for the valid range of unit IDs and a description of the unit
system.

image_ID :

The image.

unit :

The new image unit.

Returns :

TRUE on success.

gimp_image_set_tattoo_state ()

This procedure sets the tattoo state of the image. Use only by
save/load plugins that wish to preserve an images tattoo state.
Using this function at other times will produce unexpected results.
A full check of uniqueness of states in layers, channels and paths
will be performed by this procedure and a execution failure will be
returned if this fails. A failure will also be returned if the new
tattoo state value is less than the maximum tattoo value from all of
the tattoos from the paths, layers and channels. After the image
data has been loaded and all the tattoos have been set then this is
the last procedure that should be called. If effectively does a
status check on the tattoo values that have been set to make sure
that all is OK.

gimp_image_set_colormap ()

This procedure sets the entries in the specified image's colormap.
The number of colors is specified by the \"num_colors\" parameter
and corresponds to the number of INT8 triples that must be contained
in the \"cmap\" array.

gimp_image_insert_vectors ()

This procedure adds the specified vectors to the image at the given
position. Since vectors groups are not currently supported, the
parent argument must always be 0. The position argument specifies
the location of the vectors inside the stack, starting from the top
(0) and increasing. If the position is specified as -1, then the
vectors is inserted above the active vectors.