### Method

# Gimp Image insert_layer

#### Declaration [src]

    gboolean
    gimp_image_insert_layer (
      GimpImage* image,
      GimpLayer* layer,
      GimpLayer* parent,
      gint position
    )

#### Description [src]

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_group_layer_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

`layer`

  Type: `GimpLayer`

  The layer.

  The data is owned by the caller of the method.

`parent`

  Type: `GimpLayer`

  The parent layer.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`position`

  Type: `gint`

  The layer position.

#### Return value

Type: `gboolean`

TRUE on success.