# Gimp.Layer.new

    function new(image: Gimp.Image, name: String, width: Number(gint), height: Number(gint), type: Gimp.ImageType, opacity: Number(gdouble), mode: Gimp.LayerMode): Gimp.Layer {
        // Gjs wrapper for gimp_layer_new()
    }

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 [method@Image.insert_layer] method.

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

Since 3.0

image

  The image to which to add the layer.

name

  The layer name.

width

  The layer width.

height

  The layer height.

type

  The layer type.

opacity

  The layer opacity.

mode

  The layer combination mode.

Returns

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