TheUncle2k on DeviantArthttps://www.deviantart.com/theuncle2k/art/Resize-image-to-layers-150439776TheUncle2k

Deviation Actions

TheUncle2k's avatar

Resize image to layers

By
Published:
2.2K Views

Description

:bulletgreen:Update:bulletgreen:
:bulletred:1.0.3 --> BUG FIX. Script crash when cleaning the border in an image with layers completely out of boundaries. When using the cleaning function without the dependency installed now it shows a specific error message
:bulletblue:1.0.2 --> Minor header modifications
:bulletblue:1.0.1 GPL2 --> Added GPL2 license
-----------------------------------------
This is a script-fu script for GIMP.
A script is usually a way to automate repetitive or complex tasks in order to speed up the work with a software.
I decided to share my scripts because I hope they can be of some help for other GIMP users like me here on dA.
-----------------------------------------
This script needs Cut layers out of boundaries to be fully functional.

:bulletgreen:Behaviour:bulletgreen:
When saved as a script "Resize image to layers" adds a menu entry under:
Filters -> Image -> Resize image to layers
Once selected it shows a dialog box asking the size in pixel of the border and if you want to clean it.

Description
Working on an image bigger than what you need could be helpful.
"Resize image to layers" helps to resize the canvas without checking the layers' position by hand.
It verifies if the layers are inside the boundaries. If that is the case, the canvas is resized to fit around the outmost layers.
If there is a layer out of a boundary, that side of the canvas is not modified: if something is out of sight, it remains out of sight.
If you don't want to have the canvas wrapping exactly around the layers, you can set a border and the specified number of pixels is added to every side of the canvas.
However that action can show something that were previously out of sight. For that reason the option "Clean the border" removes any part that is inside of the border or outside of the canvas from all layers.
Please remember that "Clean the border" is a destructive action.

If you have no need to do otherwise, my advice is to use the script after performing "Autocrop" to the layers so the image size will be the smallest possible and there will be no interference by transparent parts.
-----------------------------------------
:bulletred:INSTALLATION:bulletred:
In order to use the script do the following:
:bulletblue:Locate the "scripts" directory. To do so open GIMP and check
Edit -> Preferences -> Folders -> Scripts
:bulletblue: Download the file and place it in the "scripts" directory without renaming it.
:bulletblue: The next time GIMP will be started the tool should be available.
:bulletred:DEPENDENCIES:bulletred:
Cut layers out of boundaries by =TheUncle2k

-----------------------------------------
:bulletgreen:More scripts
© 2010 - 2024 TheUncle2k
Comments4
Join the community to add your comment. Already a deviant? Log In
blazingamer's avatar
Is this made to do anything other than what Resize Canvas to Layers already does?