GIMP Script-fu

Artifact [863857d4da]
Login

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
<dl>
<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>[http://chiselapp.com/user/saulgoode/repository/script-fu/artifact/1798e8830fef11e639d5fe89eda4c0927d542d8c|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 [http://chiselapp.com/user/saulgoode/repository/script-fu/wiki?name=sg-scale-to-selection|is also available].
</dd></dt></dl>

Z d8f5d2841a6ad315c65099d3381128b5