GIMP Script-fu

Update of "sg-extend-layer"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.


Artifact ID: f2110648112ac3091e5a05979923a46710dd8ddf
Page Name:sg-extend-layer
Date: 2013-08-28 14:45:38
Original User: saulgoode
Parent: 52e6fc5b3ea996bf252f8e88fcad0a2cc75af0d1
Extend to Image Size
"<Image>/Layer/Extend to Image Size"
PDB Name:
sg-extend-layer.scm (after the page appears, click on the "Download" command)


This script will scale the boundaries of the current layer to fit the image size. If there is no selection when the script is run, the entire layer is scaled to the image size. If there is a selection present then that selection is protected from scaling and only the portion of the layer outside the selection will be scaled. (As a special case, if the entire layer is selected then the 1-pixel edge around the periphery of the layer will be extended to the image size.)

The script is generally intended for extending the background behind a subject without modifying the subject itself.

As an example, when "Extend to Image Size" is applied on the following image, the region between the selection (the black and white dashed line) and the layer edge (the black and yellow dashed line) will be scaled outwards to fill the image (the gray checkerboard). The selected region will not be scaled (or moved).

The following result will be produced.