GIMP Script-fu

Artifact Content

Artifact 863857d4da147f07184fe0ad90a4e793a24d7191:

Wiki page [sg-layer-fit-to-selection] by saulgoode 2014-05-19 15:38:37.
D 2014-05-19T15:38:37.753
L sg-layer-fit-to-selection
P abe6a7fd0642bb5fbfa9649cc5786cc9ff00052c
U saulgoode
W 1192
<dt><b>Command:</b> <dd>Fit to Selection</dd></dt>
<dt><b>Menu:</b> <dd>"<Image>/Layer/Fit to Selection"</dd></dt>
<dt><b>PDB Name:</b> <dd>script-fu-sg-layer-fit-to-selection</dd></dt>
<dt><b>Download:</b> <dd>[|sg-layer-fit-to-selection.scm] (after the page appears, click on the "Download" command)</dd></dt>
<dt><b>License:</b> <dd>[copyright|GPLv2+]</dd></dt>

<dt><b>Description:</b> <dd>This script will scale the current layer so that it fits within the boundaries of the selection. If there is no selection when the script is run, the layer is scaled to fit within the image canvas. The original aspect ratio of the layer is maintained.

Note: this script uses the selection in a somewhat unconventional manner. Whereas selections are usually employed to delineate affected regions of the image, this script uses it to specify the target size of the layer.

Note: a version of this command which does not preserve the aspect ratio [|is also available].

Z d8f5d2841a6ad315c65099d3381128b5