GIMP Script-fu

Update of "sg-layer-fit-to-selection"
Login

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

Overview

Artifact ID: 863857d4da147f07184fe0ad90a4e793a24d7191
Page Name:sg-layer-fit-to-selection
Date: 2014-05-19 15:38:37
Original User: saulgoode
Parent: abe6a7fd0642bb5fbfa9649cc5786cc9ff00052c (diff)
Content
Command:
Fit to Selection
Menu:
"<Image>/Layer/Fit to Selection"
PDB Name:
script-fu-sg-layer-fit-to-selection
Download:
sg-layer-fit-to-selection.scm (after the page appears, click on the "Download" command)
License:
GPLv2+

Description:

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.