See also: Main Index; Alphabetic; Misc; By Author; By Module; By Menu    External Links: The Gimp; Gimp User Manual

The Gimp layer functions

gimp_drawable_is_layer Returns whether the drawable is a layer.
gimp_drawable_is_layer_mask Returns whether the drawable is a layer mask.
gimp_floating_sel_to_layer Transforms the specified floating selection into a layer.
gimp_image_add_layer Add the specified layer to the image.
gimp_image_add_layer_mask This procedure is deprecated! Use 'gimp_layer_add_mask' instead.
gimp_image_get_active_layer Returns the specified image's active layer.
gimp_image_get_layer_by_tattoo Find a layer with a given tattoo in an image.
gimp_image_get_layers Returns the list of layers contained in the specified image.
gimp_image_lower_layer Lower the specified layer in the image's layer stack
gimp_image_lower_layer_to_bottom Lower the specified layer in the image's layer stack to bottom of stack
gimp_image_merge_visible_layers Merge the visible image layers into one.
gimp_image_pick_correlate_layer Find the layer visible at the specified coordinates.
gimp_image_raise_layer Raise the specified layer in the image's layer stack
gimp_image_raise_layer_to_top Raise the specified layer in the image's layer stack to top of stack
gimp_image_remove_layer Remove the specified layer from the image.
gimp_image_remove_layer_mask This procedure is deprecated! Use 'gimp_layer_remove_mask' instead.
gimp_image_resize_to_layers Resize the image to fit all layers.
gimp_image_set_active_layer Sets the specified image's active layer.
gimp_layer_add_alpha Add an alpha channel to the layer if it doesn't already have one.
gimp_layer_add_mask Add a layer mask to the specified layer.
gimp_layer_copy Copy a layer.
gimp_layer_create_mask Create a layer mask for the specified specified layer.
gimp_layer_delete This procedure is deprecated! Use 'gimp_drawable_delete' instead.
gimp_layer_from_mask Get the specified mask's layer.
gimp_layer_get_apply_mask Get the apply mask of the specified layer.
gimp_layer_get_edit_mask Get the edit mask of the specified layer.
gimp_layer_get_linked This procedure is deprecated! Use 'gimp_drawable_get_linked' instead.
gimp_layer_get_lock_alpha Get the lock alpha channel setting of the specified layer.
gimp_layer_get_mask Get the specified layer's mask if it exists.
gimp_layer_get_mode Get the combination mode of the specified layer.
gimp_layer_get_name This procedure is deprecated! Use 'gimp_drawable_get_name' instead.
gimp_layer_get_opacity Get the opacity of the specified layer.
gimp_layer_get_show_mask Get the show mask of the specified layer.
gimp_layer_get_tattoo This procedure is deprecated! Use 'gimp_drawable_get_tattoo' instead.
gimp_layer_get_visible This procedure is deprecated! Use 'gimp_drawable_get_visible' instead.
gimp_layer_is_floating_sel Is the specified layer a floating selection?
gimp_layer_mask This procedure is deprecated! Use 'gimp_layer_get_mask' instead.
gimp_layer_new Create a new layer.
gimp_layer_new_from_drawable Create a new layer by copying an existing drawable.
gimp_layer_remove_mask Remove the specified layer mask from the layer.
gimp_layer_resize Resize the layer to the specified extents.
gimp_layer_resize_to_image_size Resize a layer to the image size.
gimp_layer_scale Scale the layer to the specified extents.
gimp_layer_set_apply_mask Set the apply mask of the specified layer.
gimp_layer_set_edit_mask Set the edit mask of the specified layer.
gimp_layer_set_linked This procedure is deprecated! Use 'gimp_drawable_set_linked' instead.
gimp_layer_set_lock_alpha Set the lock alpha channel setting of the specified layer.
gimp_layer_set_mode Set the combination mode of the specified layer.
gimp_layer_set_name This procedure is deprecated! Use 'gimp_drawable_set_name' instead.
gimp_layer_set_offsets Set the layer offsets.
gimp_layer_set_opacity Set the opacity of the specified layer.
gimp_layer_set_show_mask Set the show mask of the specified layer.
gimp_layer_set_tattoo This procedure is deprecated! Use 'gimp_drawable_set_tattoo' instead.
gimp_layer_set_visible This procedure is deprecated! Use 'gimp_drawable_set_visible' instead.
gimp_layer_translate Translate the layer by the specified offsets.
gimp_selection_layer_alpha Transfer the specified layer's alpha channel to the selection mask.
plug_in_align_layers Align visible layers
plug_in_autocrop_layer Automagically crops a layer.

gimp_floating_sel_to_layer

Input:
LAYERfloating_selThe floating selection
Returns: nothing
This procedure transforms the specified floating selection into a layer with the same offsets and extents. The composited image will look precisely the same, but the floating selection layer will no longer be clipped to the extents of the drawable it was attached to. The floating selection will become the active layer. This procedure will not work if the floating selection has a different base type from the underlying image. This might be the case if the floating selection is above an auxillary channel or a layer mask.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_add_layer

Input:
IMAGEimageThe image
LAYERlayerThe layer
INT32positionThe layer position
Returns: nothing
This procedure adds the specified layer to the gimage at the given position. If the position is specified as -1, then the layer is inserted at the top of the layer stack. If the layer to be added has no alpha channel, it must be added at position 0. The layer type must be compatible with the image base type.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_add_layer_mask

Input:
IMAGEimageThe image
LAYERlayerThe layer to receive the mask
CHANNELmaskThe mask to add to the layer
Returns: nothing
This procedure is deprecated! Use 'gimp_layer_add_mask' instead.
;

gimp_image_get_active_layer

Input:
IMAGEimageThe image
Returns:
LAYERactive_layerThe active layer
If there is an active layer, its ID will be returned, otherwise, -1. If a channel is currently active, then no layer will be. If a layer mask is active, then this will return the associated layer.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_get_layer_by_tattoo

Input:
IMAGEimageThe image
INT32tattooThe tattoo of the layer to find
Returns:
LAYERlayerThe layer with the specified tattoo
This procedure returns the layer with the given tattoo in the specified image.
Jay Cox; 1998

gimp_image_get_layers

Input:
IMAGEimageThe image
Returns:
INT32num_layersThe number of layers contained in the image
INT32ARRAYlayer_idsThe list of layers contained in the image
This procedure returns the list of layers contained in the specified image. The order of layers is from topmost to bottommost.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_lower_layer

Input:
IMAGEimageThe image
LAYERlayerThe layer to lower
Returns: nothing
This procedure lowers the specified layer one step in the existing layer stack. It will not move the layer if there is no layer below it, or the layer has no alpha channel.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_lower_layer_to_bottom

Input:
IMAGEimageThe image
LAYERlayerThe layer to lower to bottom
Returns: nothing
This procedure lowers the specified layer to bottom of the existing layer stack. It will not move the layer if there is no layer below it, or the layer has no alpha channel.
Wolfgang Hofer; 1998

gimp_image_merge_visible_layers

Input:
IMAGEimageThe image
INT32merge_typeThe type of merge: { GIMP_EXPAND_AS_NECESSARY (0), GIMP_CLIP_TO_IMAGE (1), GIMP_CLIP_TO_BOTTOM_LAYER (2) }
Returns:
LAYERlayerThe resulting layer
This procedure combines the visible layers into a single layer using the specified merge type. A merge type of EXPAND_AS_NECESSARY expands the final layer to encompass the areas of the visible layers. A merge type of CLIP_TO_IMAGE clips the final layer to the extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the bottommost layer.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_pick_correlate_layer

Input:
IMAGEimageThe image
INT32xThe x coordinate for the pick
INT32yThe y coordinate for the pick
Returns:
LAYERlayerThe layer found at the specified coordinates
This procedure finds the layer which is visible at the specified coordinates. Layers which do not qualify are those whose extents do not pass within the specified coordinates, or which are transparent at the specified coordinates. This procedure will return -1 if no layer is found.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_raise_layer

Input:
IMAGEimageThe image
LAYERlayerThe layer to raise
Returns: nothing
This procedure raises the specified layer one step in the existing layer stack. It will not move the layer if there is no layer above it, or the layer has no alpha channel.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_raise_layer_to_top

Input:
IMAGEimageThe image
LAYERlayerThe layer to raise to top
Returns: nothing
This procedure raises the specified layer to top of the existing layer stack. It will not move the layer if there is no layer above it, or the layer has no alpha channel.
Wolfgang Hofer; 1998

gimp_image_remove_layer

Input:
IMAGEimageThe image
LAYERlayerThe layer
Returns: nothing
This procedure removes the specified layer from the image. If the layer doesn't exist, an error is returned. If there are no layers left in the image, this call will fail. If this layer is the last layer remaining, the image will become empty and have no active layer.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_image_remove_layer_mask

Input:
IMAGEimageThe image
LAYERlayerThe layer from which to remove mask
INT32modeRemoval mode: { GIMP_MASK_APPLY (0), GIMP_MASK_DISCARD (1) }
Returns: nothing
This procedure is deprecated! Use 'gimp_layer_remove_mask' instead.
;

gimp_image_resize_to_layers

Input:
IMAGEimageThe image
Returns: nothing
This procedure resizes the image to the bounding box of all layers of the image. All channels within the image are resized to the new size; this includes the image selection mask. All layers within the image are repositioned to the new image area.
Simon Budig; 2004

gimp_image_set_active_layer

Input:
IMAGEimageThe image
LAYERactive_layerThe new image active layer
Returns: nothing
If the layer exists, it is set as the active layer in the image. Any previous active layer or channel is set to inactive. An exception is a previously existing floating selection, in which case this procedure will return an execution error.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_add_alpha

Input:
LAYERlayerThe layer
Returns: nothing
This procedure adds an additional component to the specified layer if it does not already possess an alpha channel. An alpha channel makes it possible to move a layer from the bottom of the layer stack and to clear and erase to transparency, instead of the background color. This transforms images of type RGB to RGBA, GRAY to GRAYA, and INDEXED to INDEXEDA.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_add_mask

Input:
LAYERlayerThe layer to receive the mask
CHANNELmaskThe mask to add to the layer
Returns: nothing
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. Both the mask and the layer must have been created for use with the specified image.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_copy

Input:
LAYERlayerThe layer to copy
INT32add_alphaAdd an alpha channel to the copied layer
Returns:
LAYERlayer_copyThe newly copied layer
This procedure copies the specified layer and returns the copy. The newly copied layer is for use within the original layer's image. It should not be subsequently added to any other image. The copied layer can optionally have an added alpha channel. This is useful if the background layer in an image is being copied and added to the same image.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_create_mask

Input:
LAYERlayerThe layer to which to add the mask
INT32mask_typeThe type of mask: { GIMP_ADD_WHITE_MASK (0), GIMP_ADD_BLACK_MASK (1), GIMP_ADD_ALPHA_MASK (2), GIMP_ADD_ALPHA_TRANSFER_MASK (3), GIMP_ADD_SELECTION_MASK (4), GIMP_ADD_COPY_MASK (5) }
Returns:
CHANNELmaskThe newly created mask
This procedure creates a layer mask for the specified layer. Layer masks serve as an additional alpha channel for a layer. A number of ifferent types of masks are allowed for initialisation: completely white masks (which will leave the layer fully visible), completely black masks (which will give the layer complete transparency, the layer's already existing alpha channel (which will leave the layer fully visible, but which may be more useful than a white mask), the current selection or a grayscale copy of the layer. The layer mask still needs to be added to the layer. This can be done with a call to 'gimp_layer_add_mask'.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_delete

Input:
DRAWABLEdrawableThe drawable to delete
Returns: nothing
This procedure is deprecated! Use 'gimp_drawable_delete' instead.
;

gimp_layer_from_mask

Input:
CHANNELmaskMask for which to return the layer
Returns:
LAYERlayerThe mask's layer
This procedure returns the specified mask's layer , or -1 if none exists.
Geert Jordaens; 2004

gimp_layer_get_apply_mask

Input:
LAYERlayerThe layer
Returns:
INT32apply_maskThe layer apply mask
This procedure returns the specified layer's apply mask. If the value is non-zero, then the layer mask for this layer is currently being composited with the layer's alpha channel.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_get_edit_mask

Input:
LAYERlayerThe layer
Returns:
INT32edit_maskThe layer edit mask
This procedure returns the specified layer's edit mask. If the value is non-zero, then the layer mask for this layer is currently active, and not the layer.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_get_linked

Input:
DRAWABLEdrawableThe drawable
Returns:
INT32linkedThe drawable linked state (for moves)
This procedure is deprecated! Use 'gimp_drawable_get_linked' instead.
;

gimp_layer_get_lock_alpha

Input:
LAYERlayerThe layer
Returns:
INT32lock_alphaThe layer's lock alpha channel setting
This procedure returns the specified layer's lock alpha channel setting.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_get_mask

Input:
LAYERlayerThe layer
Returns:
CHANNELmaskThe layer mask
This procedure returns the specified layer's mask, or -1 if none exists.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_get_mode

Input:
LAYERlayerThe layer
Returns:
INT32modeThe layer combination mode
This procedure returns the specified layer's combination mode.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_get_name

Input:
DRAWABLEdrawableThe drawable
Returns:
STRINGnameThe drawable name
This procedure is deprecated! Use 'gimp_drawable_get_name' instead.
;

gimp_layer_get_opacity

Input:
LAYERlayerThe layer
Returns:
SUCCESSopacityThe layer opacity
This procedure returns the specified layer's opacity.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_get_show_mask

Input:
LAYERlayerThe layer
Returns:
INT32show_maskThe layer show mask
This procedure returns the specified layer's show mask. If the value is non-zero, then the layer mask for this layer is currently being shown instead of the layer.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_get_tattoo

Input:
DRAWABLEdrawableThe drawable
Returns:
INT32tattooThe drawable tattoo
This procedure is deprecated! Use 'gimp_drawable_get_tattoo' instead.
;

gimp_layer_get_visible

Input:
DRAWABLEdrawableThe drawable
Returns:
INT32visibleThe drawable visibility
This procedure is deprecated! Use 'gimp_drawable_get_visible' instead.
;

gimp_layer_is_floating_sel

Input:
LAYERlayerThe layer
Returns:
INT32is_floating_selNon-zero if the layer is a floating selection
This procedure returns whether the layer is a floating selection. Floating selections are special cases of layers which are attached to a specific drawable.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_mask

Input:
LAYERlayerThe layer
Returns:
CHANNELmaskThe layer mask
This procedure is deprecated! Use 'gimp_layer_get_mask' instead.
;

gimp_layer_new

Input:
IMAGEimageThe image to which to add the layer
INT32widthThe layer width: (0 < width)
INT32heightThe layer height: (0 < height)
INT32typeThe layer type: { GIMP_RGB_IMAGE (0), GIMP_RGBA_IMAGE (1), GIMP_GRAY_IMAGE (2), GIMP_GRAYA_IMAGE (3), GIMP_INDEXED_IMAGE (4), GIMP_INDEXEDA_IMAGE (5) }
STRINGnameThe layer name
SUCCESSopacityThe layer opacity: (0 <= opacity <= 100)
INT32modeThe layer combination mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }
Returns:
LAYERlayerThe newly created layer
This procedure creates a new layer with the specified width, height, and type. Name, 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_add_layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_remove_mask

Input:
LAYERlayerThe layer from which to remove mask
INT32modeRemoval mode: { GIMP_MASK_APPLY (0), GIMP_MASK_DISCARD (1) }
Returns: nothing
This procedure removes the specified layer mask from the layer. If the mask doesn't exist, an error is returned.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_resize

Input:
LAYERlayerThe layer
INT32new_widthNew layer width: (0 < new_width)
INT32new_heightNew layer height: (0 < new_height)
INT32offxx offset between upper left corner of old and new layers: (old - new)
INT32offyy offset between upper left corner of old and new layers: (old - new)
Returns: nothing
This procedure resizes the layer so that it's new width and height are equal to the supplied parameters. Offsets are also provided which describe the position of the previous layer's content. This operation only works if the layer has been added to an image.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_resize_to_image_size

Input:
LAYERlayerThe layer to resize
Returns: nothing
This procedure resizes the layer so that it's new width and height are equal to the width and height of its image container.
Manish Singh; 2003

gimp_layer_scale

Input:
LAYERlayerThe layer
INT32new_widthNew layer width: (0 < new_width)
INT32new_heightNew layer height: (0 < new_height)
INT32local_originUse a local origin (as opposed to the image origin)
Returns: nothing
This procedure scales the layer so that it's new width and height are equal to the supplied parameters. The "local_origin" parameter specifies whether to scale from the center of the layer, or from the image origin. This operation only works if the layer has been added to an image.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_apply_mask

Input:
LAYERlayerThe layer
INT32apply_maskThe new layer apply mask
Returns: nothing
This procedure sets the specified layer's apply mask. This controls whether the layer's mask is currently affecting the alpha channel. If there is no layer mask, this function will return an error.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_edit_mask

Input:
LAYERlayerThe layer
INT32edit_maskThe new layer edit mask
Returns: nothing
This procedure sets the specified layer's edit mask. This controls whether the layer or it's mask is currently active for editing. If the specified layer has no layer mask, then this procedure will return an error.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_linked

Input:
DRAWABLEdrawableThe drawable
INT32linkedThe new drawable linked state
Returns: nothing
This procedure is deprecated! Use 'gimp_drawable_set_linked' instead.
;

gimp_layer_set_lock_alpha

Input:
LAYERlayerThe layer
INT32lock_alphaThe new layer's lock alpha channel setting
Returns: nothing
This procedure sets the specified layer's lock alpha channel setting.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_mode

Input:
LAYERlayerThe layer
INT32modeThe new layer combination mode
Returns: nothing
This procedure sets the specified layer's combination mode.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_name

Input:
DRAWABLEdrawableThe drawable
STRINGnameThe new drawable name
Returns: nothing
This procedure is deprecated! Use 'gimp_drawable_set_name' instead.
;

gimp_layer_set_offsets

Input:
LAYERlayerThe layer
INT32offxOffset in x direction
INT32offyOffset in y direction
Returns: nothing
This procedure sets the offsets for the specified layer. The offsets are relative to the image origin and can be any values. This operation is valid only on layers which have been added to an image.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_opacity

Input:
LAYERlayerThe layer
SUCCESSopacityThe new layer opacity (0 <= opacity <= 100)
Returns: nothing
This procedure sets the specified layer's opacity.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_show_mask

Input:
LAYERlayerThe layer
INT32show_maskThe new layer show mask
Returns: nothing
This procedure sets the specified layer's show mask. This controls whether the layer or it's mask is visible. Non-zero values indicate that the mask should be visible. If the layer has no mask, then this function returns an error.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_layer_set_tattoo

Input:
DRAWABLEdrawableThe drawable
INT32tattooThe new drawable tattoo
Returns: nothing
This procedure is deprecated! Use 'gimp_drawable_set_tattoo' instead.
;

gimp_layer_set_visible

Input:
DRAWABLEdrawableThe drawable
INT32visibleThe new drawable visibility
Returns: nothing
This procedure is deprecated! Use 'gimp_drawable_set_visible' instead.
;

gimp_layer_translate

Input:
LAYERlayerThe layer
INT32offxOffset in x direction
INT32offyOffset in y direction
Returns: nothing
This procedure translates the layer by the amounts specified in the x and y arguments. These can be negative, and are considered offsets from the current position. This command only works if the layer has been added to an image. All additional layers contained in the image which have the linked flag set to TRUE w ill also be translated by the specified offsets.
Spencer Kimball & Peter Mattis; 1995-1996

gimp_selection_layer_alpha

Input:
LAYERlayerLayer with alpha
Returns: nothing
This procedure requires a layer with an alpha channel. The alpha channel information is used to create a selection mask such that for any pixel in the image defined in the specified layer, that layer pixel's alpha value is transferred to the selection mask. If the layer is undefined at a particular image pixel, the associated selection mask value is set to 0.
Spencer Kimball & Peter Mattis; 1995-1996

plug_in_align_layers

Input:
INT32run_modeInteractive, non-interactive
IMAGEimageInput image
DRAWABLEdrawableInput drawable (not used)
INT32link-afteer-alignmentLink the visible layers after alignment
INT32use-bottomuse the bottom layer as the base of alignment
Returns: nothing
Align visible layers
Shuji Narazaki; 1997

plug_in_autocrop_layer

Input:
INT32run_modeInteractive, non-interactive
IMAGEimageInput image
DRAWABLEdrawableInput drawable
Returns: nothing
blurb repeated: Automagically crops a layer.
Tim Newsome; 1997


The Gimp 2.3.2 (win32)Documentation fresh from PDB22:53:15 Fr 22.07.2005
Generated by pdb2doc.py written by Hans Breuer <Hans@Breuer.org>