### Method

# Gimp Layer add_mask

#### Declaration [src]

    gboolean
    gimp_layer_add_mask (
      GimpLayer* layer,
      GimpLayerMask* mask
    )

#### Description [src]

Add a layer mask to the specified layer.

This procedure adds a layer mask to the specified layer. Layer masks serve as an additional alpha channel for a layer. This procedure will fail if a number of prerequisites aren’t met. The layer cannot already have a layer mask. The specified mask must exist and have the same dimensions as the layer. The layer must have been created for use with the specified image and the mask must have been created with the procedure ‘gimp-layer-create-mask’.

#### Parameters

`mask` | `GimpLayerMask`
| The mask to add to the layer.
| The data is owned by the caller of the function.

#### Return value

Returns: | `gboolean`
| TRUE on success.