It is currently 13 Jul 2020, 01:57

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | 🡆 Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

auto-crop the layer to the mask

Post your Script Requests for GIMP here.
Forum rules
Request your Script(s) for GIMP here in this forum.
Provide details of steps performed in GIMP so that script can be written for the process and also give the request a name so that scripts can be named after.
Post Reply
sweeneyMark
Forum Member

auto-crop the layer to the mask

Post#1 by sweeneyMark » 19 Jun 2020, 10:38


Hi,

A script that :

Selects the current layers mask
then converts that mask to a selection
then grows the selection by 30 pixels
then autocrops the layer to that selection.

To produce a layer trimmed to the layer mask size.

Thanks
GIMP Learn rocks...
0

sweeneyMark
Forum Member

Post#2 by sweeneyMark » 19 Jun 2020, 13:20


nevermind, I surprised myself and hacked it out!
GIMP Learn rocks...
0

sweeneyMark
Forum Member

Post#3 by sweeneyMark » 19 Jun 2020, 13:21


pdb.gimp_image_select_item(image,2,mask)
pdb.gimp_selection_grow(image,64)
layer = pdb.gimp_image_get_active_layer(image)
pdb.gimp_selection_invert(image)
pdb.gimp_edit_clear(layer)
pdb.plug_in_autocrop_layer(image,layer)
GIMP Learn rocks...
2


GIMP/GL:  Tutorials | Tips | Questions | Interests | 🡆 Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest