## gimpimage

gimpimage — Operations on complete images.

## Functions

gint * | gimp_image_list ()
gint32 | gimp_image_new ()
gint32 | gimp_image_new_with_precision ()
gchar * | gimp_image_get_uri ()
gchar * | gimp_image_get_xcf_uri ()
gchar * | gimp_image_get_exported_uri ()
gchar * | gimp_image_get_imported_uri ()
gint32 | gimp_image_duplicate ()
gboolean | gimp_image_delete ()
gboolean | gimp_image_is_valid ()
GimpImageBaseType | gimp_image_base_type ()
GimpPrecision | gimp_image_get_precision ()
gint | gimp_image_width ()
gint | gimp_image_height ()
gboolean | gimp_image_free_shadow ()
gint * | gimp_image_get_layers ()
gint * | gimp_image_get_channels ()
gint32 | gimp_image_get_active_drawable ()
gint32 | gimp_image_get_floating_sel ()
gint32 | gimp_image_floating_sel_attached_to ()
gboolean | gimp_image_pick_color ()
gint32 | gimp_image_pick_correlate_layer ()
gint | gimp_image_get_item_position ()
gboolean | gimp_image_reorder_item ()
gboolean | gimp_image_raise_item ()
gboolean | gimp_image_lower_item ()
gboolean | gimp_image_raise_item_to_top ()
gboolean | gimp_image_lower_item_to_bottom ()
gboolean | gimp_image_add_layer ()
gboolean | gimp_image_insert_layer ()
gboolean | gimp_image_remove_layer ()
gboolean | gimp_image_raise_layer ()
gboolean | gimp_image_lower_layer ()
gboolean | gimp_image_raise_layer_to_top ()
gboolean | gimp_image_lower_layer_to_bottom ()
gint | gimp_image_get_layer_position ()
gboolean | gimp_image_add_channel ()
gboolean | gimp_image_insert_channel ()
gboolean | gimp_image_remove_channel ()
gboolean | gimp_image_raise_channel ()
gboolean | gimp_image_lower_channel ()
gint | gimp_image_get_channel_position ()
gint32 | gimp_image_flatten ()
gint32 | gimp_image_merge_visible_layers ()
gint32 | gimp_image_merge_down ()
gboolean | gimp_image_clean_all ()
gboolean | gimp_image_is_dirty ()
gint32 | gimp_image_get_active_layer ()
gboolean | gimp_image_set_active_layer ()
gint32 | gimp_image_get_active_channel ()
gboolean | gimp_image_set_active_channel ()
gboolean | gimp_image_unset_active_channel ()
gint32 | gimp_image_get_selection ()
gboolean | gimp_image_get_component_active ()
gboolean | gimp_image_set_component_active ()
gboolean | gimp_image_get_component_visible ()
gboolean | gimp_image_set_component_visible ()
gchar * | gimp_image_get_filename ()
gboolean | gimp_image_set_filename ()
gchar * | gimp_image_get_name ()
gboolean | gimp_image_get_resolution ()
gboolean | gimp_image_set_resolution ()
GimpUnit | gimp_image_get_unit ()
gboolean | gimp_image_set_unit ()
gboolean | gimp_image_set_tattoo_state ()
gint | gimp_image_get_tattoo_state ()
gint32 | gimp_image_get_layer_by_tattoo ()
gint32 | gimp_image_get_channel_by_tattoo ()
gint32 | gimp_image_get_vectors_by_tattoo ()
gint32 | gimp_image_get_layer_by_name ()
gint32 | gimp_image_get_channel_by_name ()
gint32 | gimp_image_get_vectors_by_name ()
guchar * | gimp_image_get_cmap ()
gboolean | gimp_image_set_cmap ()
guchar * | gimp_image_get_colormap ()
gboolean | gimp_image_set_colormap ()
gint * | gimp_image_get_vectors ()
guchar * | gimp_image_get_thumbnail_data ()
GimpMetadata * | gimp_image_get_metadata ()
gboolean | gimp_image_set_metadata ()
gboolean | gimp_image_attach_parasite ()
gboolean | gimp_image_detach_parasite ()
GimpParasite * | gimp_image_get_parasite ()
gchar ** | gimp_image_get_parasite_list ()
GimpParasite * | gimp_image_parasite_find ()
gboolean | gimp_image_parasite_list ()
gboolean | gimp_image_parasite_attach ()
gboolean | gimp_image_parasite_detach ()
gboolean | gimp_image_attach_new_parasite ()
gboolean | gimp_image_add_vectors ()
gboolean | gimp_image_insert_vectors ()
gboolean | gimp_image_remove_vectors ()
gint32 | gimp_image_get_active_vectors ()
gboolean | gimp_image_set_active_vectors ()
gboolean | gimp_image_lower_vectors ()
gboolean | gimp_image_raise_vectors ()
gboolean | gimp_image_lower_vectors_to_bottom ()
gboolean | gimp_image_raise_vectors_to_top ()
gint | gimp_image_get_vectors_position ()

## Description

Operations on complete images: creation, resizing/rescaling, and operations involving multiple layers.

## Functions

### gimp_image_list ()

    gint *
    gimp_image_list (gint *num_images);

Returns the list of images currently open.

This procedure returns the list of images currently open in GIMP.

#### Parameters

num_images | The number of images currently open. |

#### Returns

The list of images currently open. The returned value must be freed with `g_free()`.

### gimp_image_new ()

    gint32
    gimp_image_new (gint width,
                    gint height,
                    GimpImageBaseType type);

Creates a new image with the specified width, height, and type.

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.

If your image's type if INDEXED, a colormap must also be added with `gimp_image_set_colormap()`. An indexed image without a colormap will output unexpected colors.

#### Parameters

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_new_with_precision ()

    gint32
    gimp_image_new_with_precision (gint width,
                                   gint height,
                                   GimpImageBaseType type,
                                   GimpPrecision precision);

Creates a new image with the specified width, height, type and precision.

Creates a new image, undisplayed with the specified extents, type and precision. Indexed images can only be created at GIMP_PRECISION_U8_GAMMA precision. See `gimp_image_new()` for further details.

#### Parameters

width | The width of the image. |
height | The height of the image. |
type | The type of image. |
precision | The precision. |

#### Returns

The ID of the newly created image.

Since: 2.10

### gimp_image_get_uri ()

    gchar *
    gimp_image_get_uri (gint32 image_ID);

Returns the URI for the specified image.

This procedure returns the URI associated with the specified image. The image has an URI 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-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.

#### Parameters

image_ID | The image. |

#### Returns

The URI. The returned value must be freed with `g_free()`.

Since: 2.8

### gimp_image_get_xcf_uri ()

    gchar *
    gimp_image_get_xcf_uri (gint32 image_ID);

Returns the XCF URI for the specified image.

This procedure returns the XCF URI associated with the image. If there is no such URI, this procedure returns `NULL`.

#### Parameters

image_ID | The image. |

#### Returns

The imported URI. The returned value must be freed with `g_free()`.

Since: 2.8

### gimp_image_get_exported_uri ()

    gchar *
    gimp_image_get_exported_uri (gint32 image_ID);

Returns the exported URI for the specified image.

This procedure returns the URI associated with the specified image if the image was exported a non-native GIMP format. If the image was not exported, this procedure returns `NULL`.

#### Parameters

image_ID | The image. |

#### Returns

The exported URI. The returned value must be freed with `g_free()`.

Since: 2.8

### gimp_image_get_imported_uri ()

    gchar *
    gimp_image_get_imported_uri (gint32 image_ID);

Returns the imported URI for the specified image.

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`.

#### Parameters

image_ID | The image. |

#### Returns

The imported URI. The returned value must be freed with `g_free()`.

Since: 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.

#### Parameters

image_ID | The image. |

#### Returns

The new, duplicated image.

### gimp_image_delete ()

    gboolean
    gimp_image_delete (gint32 image_ID);

Delete the specified image.

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.

#### Parameters

image_ID | The image. |

#### Returns

TRUE on success.

### gimp_image_is_valid ()

    gboolean
    gimp_image_is_valid (gint32 image_ID);

Returns TRUE if the image is valid.

This procedure checks if the given image ID is valid and refers to an existing image.

#### Parameters

image_ID | The image to check. |

#### Returns

Whether the image ID is valid.

Since: 2.4

### gimp_image_base_type ()

    GimpImageBaseType
    gimp_image_base_type (gint32 image_ID);

Get the base type of the image.

This procedure returns the image's base type. Layers in the image must be of this subtype, but can have an optional alpha channel.

#### Parameters

image_ID | The image. |

#### Returns

The image's base type.

### gimp_image_get_precision ()

    GimpPrecision
    gimp_image_get_precision (gint32 image_ID);

Get the precision of the image.

This procedure returns the image's precision.

#### Parameters

image_ID | The image. |

#### Returns

The image's precision.

Since: 2.10

### gimp_image_width ()

    gint
    gimp_image_width (gint32 image_ID);

Return the width of the image

This procedure returns the image's width. This value is independent of any of the layers in this image. This is the \"canvas\" width.

#### Parameters

image_ID | The image. |

#### Returns

The image's width.

### gimp_image_height ()

    gint
    gimp_image_height (gint32 image_ID);

Return the height of the image

This procedure returns the image's height. This value is independent of any of the layers in this image. This is the \"canvas\" height.

#### Parameters

image_ID | The image. |

#### Returns

The image's height.

### gimp_image_free_shadow ()

    gboolean
    gimp_image_free_shadow (gint32 image_ID);

`gimp_image_free_shadow` is deprecated and should not be used in newly-written code.

Use `gimp_drawable_free_shadow()` instead.

#### Parameters

image_ID | The image. |

#### Returns

TRUE on success.

### gimp_image_get_layers ()

    gint *
    gimp_image_get_layers (gint32 image_ID,
                           gint *num_layers);

Returns the list of layers contained in the specified image.

This procedure returns the list of layers contained in the specified image. The order of layers is from topmost to bottommost.

#### Parameters

image_ID | The image. |
num_layers | The number of layers contained in the image. |

#### Returns

The list of layers contained in the image. The returned value must be freed with `g_free()`.

### gimp_image_get_channels ()

    gint *
    gimp_image_get_channels (gint32 image_ID,
                             gint *num_channels);

Returns the list of channels contained in the specified image.

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. Note that \"channels\" are custom channels and do not include the image's color components.

#### Parameters

image_ID | The image. |
num_channels | The number of channels contained in the image. |

#### Returns

The list of channels contained in the image. The returned value must be freed with `g_free()`.

### 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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

image_ID | The image. |

#### Returns

The drawable the floating selection is attached to.

### gimp_image_pick_color ()

    gboolean
    gimp_image_pick_color (gint32 image_ID,
                           gint32 drawable_ID,
                           gdouble x,
                           gdouble y,
                           gboolean sample_merged,
                           gboolean sample_average,
                           gdouble average_radius,
                           GimpRGB *color);

Determine the color at the given drawable coordinates

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.

#### Parameters

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 ()

    gint32
    gimp_image_pick_correlate_layer (gint32 image_ID,
                                     gint x,
                                     gint y);

Find the layer visible at the specified coordinates.

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.

#### Parameters

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 ()

    gint
    gimp_image_get_item_position (gint32 image_ID,
                                  gint32 item_ID);

Returns the position of the item in its level of its item tree.

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.

#### Parameters

image_ID | The image. |
item_ID | The item. |

#### Returns

The position of the item in its level in the item tree.

Since: 2.8

### gimp_image_reorder_item ()

    gboolean
    gimp_image_reorder_item (gint32 image_ID,
                             gint32 item_ID,
                             gint32 parent_ID,
                             gint position);

Reorder the specified item within its item tree

This procedure reorders the specified item within its item tree.

#### Parameters

image_ID | The image. |
item_ID | The item to reorder. |
parent_ID | The new parent item. |
position | The new position of the item. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_image_raise_item ()

    gboolean
    gimp_image_raise_item (gint32 image_ID,
                           gint32 item_ID);

Raise the specified item in its level in its item tree

This procedure raises the specified item one step in the item tree. The procecure call will fail if there is no item above it.

#### Parameters

image_ID | The image. |
item_ID | The item to raise. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_image_lower_item ()

    gboolean
    gimp_image_lower_item (gint32 image_ID,
                           gint32 item_ID);

Lower the specified item in its level in its item tree

This procedure lowers the specified item one step in the item tree. The procecure call will fail if there is no item below it.

#### Parameters

image_ID | The image. |
item_ID | The item to lower. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_image_raise_item_to_top ()

    gboolean
    gimp_image_raise_item_to_top (gint32 image_ID,
                                  gint32 item_ID);

Raise the specified item to the top of its level in its item tree

This procedure raises the specified item to top of its level in the item tree. It will not move the item if there is no item above it.

#### Parameters

image_ID | The image. |
item_ID | The item to raise to top. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_image_lower_item_to_bottom ()

    gboolean
    gimp_image_lower_item_to_bottom (gint32 image_ID,
                                     gint32 item_ID);

Lower the specified item to the bottom of its level in its item tree

This procedure lowers the specified item to bottom of its level in the item tree. It will not move the layer if there is no layer below it.

#### Parameters

image_ID | The image. |
item_ID | The item to lower to bottom. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_image_add_layer ()

    gboolean
    gimp_image_add_layer (gint32 image_ID,
                          gint32 layer_ID,
                          gint position);

`gimp_image_add_layer` is deprecated and should not be used in newly-written code.

Use `gimp_image_insert_layer()` instead.

#### Parameters

image_ID | The image. |
layer_ID | The layer. |
position | The layer position. |

#### Returns

TRUE on success.

### gimp_image_insert_layer ()

    gboolean
    gimp_image_insert_layer (gint32 image_ID,
                             gint32 layer_ID,
                             gint32 parent_ID,
                             gint position);

Add the specified layer to the image.

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.

#### Parameters

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 ()

    gboolean
    gimp_image_remove_layer (gint32 image_ID,
                             gint32 layer_ID);

Remove the specified layer from the image.

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.

#### Parameters

image_ID | The image. |
layer_ID | The layer. |

#### Returns

TRUE on success.

### gimp_image_raise_layer ()

    gboolean
    gimp_image_raise_layer (gint32 image_ID,
                            gint32 layer_ID);

`gimp_image_raise_layer` is deprecated and should not be used in newly-written code.

Use `gimp_image_raise_item()` instead.

#### Parameters

image_ID | The image. |
layer_ID | The layer to raise. |

#### Returns

TRUE on success.

### gimp_image_lower_layer ()

    gboolean
    gimp_image_lower_layer (gint32 image_ID,
                            gint32 layer_ID);

`gimp_image_lower_layer` is deprecated and should not be used in newly-written code.

Use `gimp_image_lower_item()` instead.

#### Parameters

image_ID | The image. |
layer_ID | The layer to lower. |

#### Returns

TRUE on success.

### gimp_image_raise_layer_to_top ()

    gboolean
    gimp_image_raise_layer_to_top (gint32 image_ID,
                                   gint32 layer_ID);

`gimp_image_raise_layer_to_top` is deprecated and should not be used in newly-written code.

Use `gimp_image_raise_item_to_top()` instead.

#### Parameters

image_ID | The image. |
layer_ID | The layer to raise to top. |

#### Returns

TRUE on success.

### gimp_image_lower_layer_to_bottom ()

    gboolean
    gimp_image_lower_layer_to_bottom (gint32 image_ID,
                                      gint32 layer_ID);

`gimp_image_lower_layer_to_bottom` is deprecated and should not be used in newly-written code.

Use `gimp_image_lower_item_to_bottom()` instead.

#### Parameters

image_ID | The image. |
layer_ID | The layer to lower to bottom. |

#### Returns

TRUE on success.

### gimp_image_get_layer_position ()

    gint
    gimp_image_get_layer_position (gint32 image_ID,
                                   gint32 layer_ID);

`gimp_image_get_layer_position` is deprecated and should not be used in newly-written code.

Use `gimp_image_get_item_position()` instead.

#### Parameters

image_ID | The image. |
layer_ID | The layer. |

#### Returns

The position of the layer in the layer stack.

Since: 2.4

### gimp_image_add_channel ()

    gboolean
    gimp_image_add_channel (gint32 image_ID,
                            gint32 channel_ID,
                            gint position);

`gimp_image_add_channel` is deprecated and should not be used in newly-written code.

Use `gimp_image_insert_channel()` instead.

#### Parameters

image_ID | The image. |
channel_ID | The channel. |
position | The channel position. |

#### Returns

TRUE on success.

### gimp_image_insert_channel ()

    gboolean
    gimp_image_insert_channel (gint32 image_ID,
                               gint32 channel_ID,
                               gint32 parent_ID,
                               gint position);

Add the specified channel to the image.

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.

#### Parameters

image_ID | The image. |
channel_ID | The channel. |
parent_ID | The parent channel. |
position | The channel position. |

#### Returns

TRUE on success.

### gimp_image_remove_channel ()

    gboolean
    gimp_image_remove_channel (gint32 image_ID,
                               gint32 channel_ID);

Remove the specified channel from the image.

This procedure removes the specified channel from the image. If the channel doesn't exist, an error is returned.

#### Parameters

image_ID | The image. |
channel_ID | The channel. |

#### Returns

TRUE on success.

### gimp_image_raise_channel ()

    gboolean
    gimp_image_raise_channel (gint32 image_ID,
                              gint32 channel_ID);

`gimp_image_raise_channel` is deprecated and should not be used in newly-written code.

Use `gimp_image_raise_item()` instead.

#### Parameters

image_ID | The image. |
channel_ID | The channel to raise. |

#### Returns

TRUE on success.

### gimp_image_lower_channel ()

    gboolean
    gimp_image_lower_channel (gint32 image_ID,
                              gint32 channel_ID);

`gimp_image_lower_channel` is deprecated and should not be used in newly-written code.

Use `gimp_image_lower_item()` instead.

#### Parameters

image_ID | The image. |
channel_ID | The channel to lower. |

#### Returns

TRUE on success.

### gimp_image_get_channel_position ()

    gint
    gimp_image_get_channel_position (gint32 image_ID,
                                     gint32 channel_ID);

`gimp_image_get_channel_position` is deprecated and should not be used in newly-written code.

Use `gimp_image_get_item_position()` instead.

#### Parameters

image_ID | The image. |
channel_ID | The channel. |

#### Returns

The position of the channel in the channel stack.

Since: 2.4

### 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.

#### Parameters

image_ID | The image. |

#### Returns

The resulting layer.

### gimp_image_merge_visible_layers ()

    gint32
    gimp_image_merge_visible_layers (gint32 image_ID,
                                     GimpMergeType merge_type);

Merge the visible image layers into one.

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.

#### Parameters

image_ID | The image. |
merge_type | The type of merge. |

#### Returns

The resulting layer.

### gimp_image_merge_down ()

    gint32
    gimp_image_merge_down (gint32 image_ID,
                           gint32 merge_layer_ID,
                           GimpMergeType merge_type);

Merge the layer passed and the first visible layer below.

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.

#### Parameters

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 ()

    gboolean
    gimp_image_clean_all (gint32 image_ID);

Set the image dirty count to 0.

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.

#### Parameters

image_ID | The image. |

#### Returns

TRUE on success.

### gimp_image_is_dirty ()

    gboolean
    gimp_image_is_dirty (gint32 image_ID);

Checks if the image has unsaved changes.

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.

#### Parameters

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.

#### Parameters

image_ID | The image. |

#### Returns

The active layer.

### gimp_image_set_active_layer ()

    gboolean
    gimp_image_set_active_layer (gint32 image_ID,
                                 gint32 active_layer_ID);

Sets the specified image's 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.

#### Parameters

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.

#### Parameters

image_ID | The image. |

#### Returns

The active channel.

### gimp_image_set_active_channel ()

    gboolean
    gimp_image_set_active_channel (gint32 image_ID,
                                   gint32 active_channel_ID);

Sets the specified image's active channel.

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

#### Parameters

image_ID | The image. |
active_channel_ID | The new image active channel. |

#### Returns

TRUE on success.

### gimp_image_unset_active_channel ()

    gboolean
    gimp_image_unset_active_channel (gint32 image_ID);

Unsets the active channel in the specified image.

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.

#### Parameters

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.

#### Parameters

image_ID | The image. |

#### Returns

The selection channel.

### gimp_image_get_component_active ()

    gboolean
    gimp_image_get_component_active (gint32 image_ID,
                                     GimpChannelType component);

Returns if the specified image's image component is 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.

#### Parameters

image_ID | The image. |
component | The image component. |

#### Returns

Component is active.

### gimp_image_set_component_active ()

    gboolean
    gimp_image_set_component_active (gint32 image_ID,
                                     GimpChannelType component,
                                     gboolean active);

Sets if the specified image's image component is 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.

#### Parameters

image_ID | The image. |
component | The image component. |
active | Component is active. |

#### Returns

TRUE on success.

### gimp_image_get_component_visible ()

    gboolean
    gimp_image_get_component_visible (gint32 image_ID,
                                      GimpChannelType component);

Returns if the specified image's image component is 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.

#### Parameters

image_ID | The image. |
component | The image component. |

#### Returns

Component is visible.

### gimp_image_set_component_visible ()

    gboolean
    gimp_image_set_component_visible (gint32 image_ID,
                                      GimpChannelType component,
                                      gboolean visible);

Sets if the specified image's image component is 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.

#### Parameters

image_ID | The image. |
component | The image component. |
visible | Component is visible. |

#### Returns

TRUE on success.

### gimp_image_get_filename ()

    gchar *
    gimp_image_get_filename (gint32 image_ID);

Returns the specified image's 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()`.

#### Parameters

image_ID | The image. |

#### Returns

The filename. The returned value must be freed with `g_free()`.

### gimp_image_set_filename ()

    gboolean
    gimp_image_set_filename (gint32 image_ID,
                             const gchar *filename);

Sets the specified image's filename.

This procedure sets the specified image's filename. The filename should be in the filesystem encoding.

#### Parameters

image_ID | The image. |
filename | The new image filename. |

#### Returns

TRUE on success.

### gimp_image_get_name ()

    gchar *
    gimp_image_get_name (gint32 image_ID);

Returns the specified image's name.

This procedure returns the image's name. If the image has a filename or an URI, then the returned name contains the filename's or URI's base name (the last component of the path). Otherwise it is the translated string \"Untitled\". The returned name is formatted like the image name in the image window title, it may contain '[]', '(imported)' etc. and should only be used to label user interface elements. Never use it to construct filenames.

#### Parameters

image_ID | The image. |

#### Returns

The name. The returned value must be freed with `g_free()`.

### gimp_image_get_resolution ()

    gboolean
    gimp_image_get_resolution (gint32 image_ID,
                               gdouble *xresolution,
                               gdouble *yresolution);

Returns the specified image's resolution.

This procedure returns the specified image's resolution in dots per inch. This value is independent of any of the layers in this image.

#### Parameters

image_ID | The image. |
xresolution | The resolution in the x-axis, in dots per inch. |
yresolution | The resolution in the y-axis, in dots per inch. |

#### Returns

TRUE on success.

### gimp_image_set_resolution ()

    gboolean
    gimp_image_set_resolution (gint32 image_ID,
                               gdouble xresolution,
                               gdouble yresolution);

Sets the specified image's resolution.

This procedure sets the specified image's resolution in dots per inch. This value is independent of any of the layers in this image. No scaling or resizing is performed.

#### Parameters

image_ID | The image. |
xresolution | The new image resolution in the x-axis, in dots per inch. |
yresolution | The new image resolution in the y-axis, in dots per inch. |

#### Returns

TRUE on success.

### gimp_image_get_unit ()

    GimpUnit
    gimp_image_get_unit (gint32 image_ID);

Returns the specified image's 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.

#### Parameters

image_ID | The image. |

#### Returns

The unit.

### gimp_image_set_unit ()

    gboolean
    gimp_image_set_unit (gint32 image_ID,
                         GimpUnit unit);

Sets the specified image's 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.

#### Parameters

image_ID | The image. |
unit | The new image unit. |

#### Returns

TRUE on success.

### gimp_image_set_tattoo_state ()

    gboolean
    gimp_image_set_tattoo_state (gint32 image_ID,
                                 gint tattoo_state);

Set the tattoo state associated with the image.

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.

#### Parameters

image_ID | The image. |
tattoo_state | The new image tattoo state. |

#### Returns

TRUE on success.

### gimp_image_get_tattoo_state ()

    gint
    gimp_image_get_tattoo_state (gint32 image_ID);

Returns the tattoo state associated with the image.

This procedure returns 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.

#### Parameters

image_ID | The image. |

#### Returns

The tattoo state.

### gimp_image_get_layer_by_tattoo ()

    gint32
    gimp_image_get_layer_by_tattoo (gint32 image_ID,
                                    gint tattoo);

Find a layer with a given tattoo in an image.

This procedure returns the layer with the given tattoo in the specified image.

#### Parameters

image_ID | The image. |
tattoo | The tattoo of the layer to find. |

#### Returns

The layer with the specified tattoo.

### gimp_image_get_channel_by_tattoo ()

    gint32
    gimp_image_get_channel_by_tattoo (gint32 image_ID,
                                      gint tattoo);

Find a channel with a given tattoo in an image.

This procedure returns the channel with the given tattoo in the specified image.

#### Parameters

image_ID | The image. |
tattoo | The tattoo of the channel to find. |

#### Returns

The channel with the specified tattoo.

### gimp_image_get_vectors_by_tattoo ()

    gint32
    gimp_image_get_vectors_by_tattoo (gint32 image_ID,
                                      gint tattoo);

Find a vectors with a given tattoo in an image.

This procedure returns the vectors with the given tattoo in the specified image.

#### Parameters

image_ID | The image. |
tattoo | The tattoo of the vectors to find. |

#### Returns

The vectors with the specified tattoo.

Since: 2.6

### gimp_image_get_layer_by_name ()

    gint32
    gimp_image_get_layer_by_name (gint32 image_ID,
                                  const gchar *name);

Find a layer with a given name in an image.

This procedure returns the layer with the given name in the specified image.

#### Parameters

image_ID | The image. |
name | The name of the layer to find. |

#### Returns

The layer with the specified name.

Since: 2.8

### gimp_image_get_channel_by_name ()

    gint32
    gimp_image_get_channel_by_name (gint32 image_ID,
                                    const gchar *name);

Find a channel with a given name in an image.

This procedure returns the channel with the given name in the specified image.

#### Parameters

image_ID | The image. |
name | The name of the channel to find. |

#### Returns

The channel with the specified name.

Since: 2.8

### gimp_image_get_vectors_by_name ()

    gint32
    gimp_image_get_vectors_by_name (gint32 image_ID,
                                    const gchar *name);

Find a vectors with a given name in an image.

This procedure returns the vectors with the given name in the specified image.

#### Parameters

image_ID | The image. |
name | The name of the vectors to find. |

#### Returns

The vectors with the specified name.

Since: 2.8

### gimp_image_get_cmap ()

    guchar *
    gimp_image_get_cmap (gint32 image_ID,
                         gint *num_colors);

`gimp_image_get_cmap` is deprecated and should not be used in newly-written code.

Use `gimp_image_get_colormap()` instead.

#### Parameters

image_ID | The image. |
num_colors | Number of colors in the colormap array. |

#### Returns

The image's colormap.

### gimp_image_set_cmap ()

    gboolean
    gimp_image_set_cmap (gint32 image_ID,
                         const guchar *cmap,
                         gint num_colors);

`gimp_image_set_cmap` is deprecated and should not be used in newly-written code.

Use `gimp_image_set_colormap()` instead.

#### Parameters

image_ID | The image. |
cmap | The new colormap values. |
num_colors | Number of colors in the colormap array. |

#### Returns

TRUE on success.

### gimp_image_get_colormap ()

    guchar *
    gimp_image_get_colormap (gint32 image_ID,
                             gint *num_colors);

Returns the image's colormap

This procedure returns an actual pointer to the image's colormap, as well as the number of colors contained in the colormap. If the image is not of base type INDEXED, this pointer will be NULL.

#### Parameters

image_ID | The image. |
num_colors | Returns the number of colors in the colormap array. |

#### Returns

The image's colormap.

### gimp_image_set_colormap ()

    gboolean
    gimp_image_set_colormap (gint32 image_ID,
                             const guchar *colormap,
                             gint num_colors);

Sets the entries in the image's 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.

#### Parameters

image_ID | The image. |
colormap | The new colormap values. |
num_colors | Number of colors in the colormap array. |

#### Returns

TRUE on success.

### gimp_image_get_vectors ()

    gint *
    gimp_image_get_vectors (gint32 image_ID,
                            gint *num_vectors);

Returns the list of vectors contained in the specified image.

This procedure returns the list of vectors contained in the specified image.

#### Parameters

image_ID | The image. |
num_vectors | The number of vectors contained in the image. |

#### Returns

The list of vectors contained in the image. The returned value must be freed with `g_free()`.

Since: 2.4

### gimp_image_get_thumbnail_data ()

    guchar *
    gimp_image_get_thumbnail_data (gint32 image_ID,
                                   gint *width,
                                   gint *height,
                                   gint *bpp);

### gimp_image_get_metadata ()

    GimpMetadata *
    gimp_image_get_metadata (gint32 image_ID);

Returns the image's metadata.

Returns exif/iptc/xmp metadata from the image.

#### Parameters

image_ID | The image. |

#### Returns

The exif/ptc/xmp metadata, or `NULL` if there is none.

Since: 2.10

### gimp_image_set_metadata ()

    gboolean
    gimp_image_set_metadata (gint32 image_ID,
                             GimpMetadata *metadata);

Set the image's metadata.

Sets exif/iptc/xmp metadata on the image, or deletes it if `metadata` is `NULL`.

#### Parameters

image_ID | The image. |
metadata | The exif/ptc/xmp metadata. |

#### Returns

TRUE on success.

Since: 2.10

### gimp_image_attach_parasite ()

    gboolean
    gimp_image_attach_parasite (gint32 image_ID,
                                const GimpParasite *parasite);

Add a parasite to an image.

This procedure attaches a parasite to an image. It has no return values.

#### Parameters

image_ID | The image. |
parasite | The parasite to attach to an image. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_image_detach_parasite ()

    gboolean
    gimp_image_detach_parasite (gint32 image_ID,
                                const gchar *name);

Removes a parasite from an image.

This procedure detaches a parasite from an image. It has no return values.

#### Parameters

image_ID | The image. |
name | The name of the parasite to detach from an image. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_image_get_parasite ()

    GimpParasite *
    gimp_image_get_parasite (gint32 image_ID,
                             const gchar *name);

Look up a parasite in an image

Finds and returns the parasite that was previously attached to an image.

#### Parameters

image_ID | The image. |
name | The name of the parasite to find. |

#### Returns

The found parasite.

Since: 2.8

### gimp_image_get_parasite_list ()

    gchar **
    gimp_image_get_parasite_list (gint32 image_ID,
                                  gint *num_parasites);

List all parasites.

Returns a list of all currently attached parasites.

#### Parameters

image_ID | The image. |
num_parasites | The number of attached parasites. |

#### Returns

The names of currently attached parasites. The returned value must be freed with `g_strfreev()`.

Since: 2.8

### gimp_image_parasite_find ()

    GimpParasite *
    gimp_image_parasite_find (gint32 image_ID,
                              const gchar *name);

`gimp_image_parasite_find` is deprecated and should not be used in newly-written code.

Use `gimp_image_get_parasite()` instead.

#### Parameters

image_ID | The image. |
name | The name of the parasite to find. |

#### Returns

The found parasite.

### gimp_image_parasite_list ()

    gboolean
    gimp_image_parasite_list (gint32 image_ID,
                              gint *num_parasites,
                              gchar ***parasites);

`gimp_image_parasite_list` is deprecated and should not be used in newly-written code.

Use `gimp_image_get_parasite_list()` instead.

#### Parameters

image_ID | The image. |
num_parasites | The number of attached parasites. |
parasites | The names of currently attached parasites. |

#### Returns

TRUE on success.

### gimp_image_parasite_attach ()

    gboolean
    gimp_image_parasite_attach (gint32 image_ID,
                                const GimpParasite *parasite);

`gimp_image_parasite_attach` is deprecated and should not be used in newly-written code.

Use `gimp_image_attach_parasite()` instead.

#### Parameters

image_ID | The image. |
parasite | The parasite to attach to an image. |

#### Returns

TRUE on success.

### gimp_image_parasite_detach ()

    gboolean
    gimp_image_parasite_detach (gint32 image_ID,
                                const gchar *name);

`gimp_image_parasite_detach` is deprecated and should not be used in newly-written code.

Use `gimp_image_detach_parasite()` instead.

#### Parameters

image_ID | The image. |
name | The name of the parasite to detach from an image. |

#### Returns

TRUE on success.

### gimp_image_attach_new_parasite ()

    gboolean
    gimp_image_attach_new_parasite (gint32 image_ID,
                                    const gchar *name,
                                    gint flags,
                                    gint size,
                                    gconstpointer data);

`gimp_image_attach_new_parasite` is deprecated and should not be used in newly-written code.

Use `gimp_image_attach_parasite()` instead.

Convenience function that creates a parasite and attaches it to GIMP.

#### Parameters

image_ID | the ID of the image to attach the GimpParasite to. |
name | the name of the GimpParasite to create and attach. |
flags | the flags set on the GimpParasite. |
size | the size of the parasite data in bytes. |
data | a pointer to the data attached with the GimpParasite. |

#### Returns

TRUE on successful creation and attachment of the new parasite.

See Also: `gimp_image_parasite_attach()`

### gimp_image_add_vectors ()

    gboolean
    gimp_image_add_vectors (gint32 image_ID,
                            gint32 vectors_ID,
                            gint position);

`gimp_image_add_vectors` is deprecated and should not be used in newly-written code.

Use `gimp_image_insert_vectors()` instead.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors object. |
position | The vectors objects position. |

#### Returns

TRUE on success.

### gimp_image_insert_vectors ()

    gboolean
    gimp_image_insert_vectors (gint32 image_ID,
                               gint32 vectors_ID,
                               gint32 parent_ID,
                               gint position);

Add the specified vectors to the image.

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.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors. |
parent_ID | The parent vectors. |
position | The vectors position. |

#### Returns

TRUE on success.

### gimp_image_remove_vectors ()

    gboolean
    gimp_image_remove_vectors (gint32 image_ID,
                               gint32 vectors_ID);

Remove the specified path from the image.

This procedure removes the specified path from the image. If the path doesn't exist, an error is returned.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors object. |

#### Returns

TRUE on success.

Since: 2.4

### gimp_image_get_active_vectors ()

    gint32
    gimp_image_get_active_vectors (gint32 image_ID);

Returns the specified image's active vectors.

If there is an active path, its ID will be returned, otherwise, -1.

#### Parameters

image_ID | The image. |

#### Returns

The active vectors.

### gimp_image_set_active_vectors ()

    gboolean
    gimp_image_set_active_vectors (gint32 image_ID,
                                   gint32 active_vectors_ID);

Sets the specified image's active vectors.

If the path exists, it is set as the active path in the image.

#### Parameters

image_ID | The image. |
active_vectors_ID | The new image active vectors. |

#### Returns

TRUE on success.

### gimp_image_lower_vectors ()

    gboolean
    gimp_image_lower_vectors (gint32 image_ID,
                              gint32 vectors_ID);

`gimp_image_lower_vectors` is deprecated and should not be used in newly-written code.

Use `gimp_image_lower_item()` instead.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors object to lower. |

#### Returns

TRUE on success.

Since: 2.4

### gimp_image_raise_vectors ()

    gboolean
    gimp_image_raise_vectors (gint32 image_ID,
                              gint32 vectors_ID);

`gimp_image_raise_vectors` is deprecated and should not be used in newly-written code.

Use `gimp_image_raise_item()` instead.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors object to raise. |

#### Returns

TRUE on success.

Since: 2.4

### gimp_image_lower_vectors_to_bottom ()

    gboolean
    gimp_image_lower_vectors_to_bottom (gint32 image_ID,
                                        gint32 vectors_ID);

`gimp_image_lower_vectors_to_bottom` is deprecated and should not be used in newly-written code.

Use `gimp_image_lower_item_to_bottom()` instead.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors object to lower to bottom. |

#### Returns

TRUE on success.

Since: 2.4

### gimp_image_raise_vectors_to_top ()

    gboolean
    gimp_image_raise_vectors_to_top (gint32 image_ID,
                                     gint32 vectors_ID);

`gimp_image_raise_vectors_to_top` is deprecated and should not be used in newly-written code.

Use `gimp_image_raise_item_to_top()` instead.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors object to raise to top. |

#### Returns

TRUE on success.

Since: 2.4

### gimp_image_get_vectors_position ()

    gint
    gimp_image_get_vectors_position (gint32 image_ID,
                                     gint32 vectors_ID);

`gimp_image_get_vectors_position` is deprecated and should not be used in newly-written code.

Use `gimp_image_get_item_position()` instead.

#### Parameters

image_ID | The image. |
vectors_ID | The vectors object. |

#### Returns

The position of the vectors object in the vectors stack.

Since: 2.4

## Types and Values