Gimp.Layer.new_from_pixbuf
Description: Reference for Gimp.Layer.new_from_pixbuf

### Constructor

# Gimp Layernew_from_pixbuf

since: 2.2

#### Declaration [src]

    GimpLayer*
    gimp_layer_new_from_pixbuf (
      GimpImage* image,
      const gchar* name,
      GdkPixbuf* pixbuf,
      gdouble opacity,
      GimpLayerMode mode,
      gdouble progress_start,
      gdouble progress_end
    )

#### Description [src]

Create a new layer from a %GdkPixbuf.

This procedure creates a new layer from the given %GdkPixbuf. The image has to be an RGB image and just like with `gimp_layer_new()` you will still need to add the layer to it.

If you pass `progress_end` > `progress_start` to this function, `gimp_progress_update()` will be called for. You have to call `gimp_progress_init()` beforehand then.

Available since: 2.2

#### Parameters

`image`

  Type: `GimpImage`

  The RGB 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 data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`pixbuf`

  Type: `GdkPixbuf`

  A GdkPixbuf.

  The data is owned by the caller of the function.

`opacity`

  Type: `gdouble`

  The layer opacity.

`mode`

  Type: `GimpLayerMode`

  The layer combination mode.

`progress_start`

  Type: `gdouble`

  Start of progress.

`progress_end`

  Type: `gdouble`

  End of progress.

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