Gimp.Layer.new
Description: Reference for Gimp.Layer.new

### Constructor

# Gimp Layernew

since: 3.0

#### Declaration [src]

    GimpLayer*
    gimp_layer_new (
      GimpImage* image,
      const gchar* name,
      gint width,
      gint height,
      GimpImageType type,
      gdouble opacity,
      GimpLayerMode mode
    )

#### Description [src]

Create a new layer.

This procedure creates a new layer with the specified `width`, `height`, and `type`. If `name` is `NULL`, a default layer name will be used. `opacity` and `mode` are also supplied parameters.

The new layer still needs to be added to the image, as this is not automatic. Add the new layer with the `gimp_image_insert_layer()` method.

Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls.

Available since: 3.0

#### Parameters

`image`

  Type: `GimpImage`

  The image to which to add the layer.

  The data is owned by the caller of the function.

`name`

  Type: `const gchar*`

  The layer name.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`width`

  Type: `gint`

  The layer width.

`height`

  Type: `gint`

  The layer height.

`type`

  Type: `GimpImageType`

  The layer type.

`opacity`

  Type: `gdouble`

  The layer opacity.

`mode`

  Type: `GimpLayerMode`

  The layer combination mode.

#### Return value

Type: `GimpLayer`

The newly created layer. The object belongs to libgimp and you should not free it.

The data is owned by the called function.