# Gimp.Image.insert_layer

    @accepts(Gimp.Image, Gimp.Layer, Gimp.Layer, int)
    @returns(bool)
    def insert_layer(self, layer, parent, position):
        # Python wrapper for gimp_image_insert_layer()

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.

self

  The image.

layer

  The layer.

parent

  The parent layer.

position

  The layer position.

Returns