It is currently Thu May 23, 2013 6:08 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Autocrop all layers
PostPosted: Mon Jun 06, 2011 8:38 pm  (#11) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9012
Location: "Looking for my eraser" =P
It isn't a script to modify many layers at once.it just shrinks the layer boundary around the contents of many linked layers at one time.
I do a lot of Layer to Image size on my projects and then need them all auto cropped back to their original boundary.
This makes it much faster.

For some reason i just like boundaries as close as possible when i rotate text or objects.Just me i guess but it seems more precise.

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 

 Post subject: Re: Autocrop all layers
PostPosted: Mon Jun 06, 2011 8:48 pm  (#12) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2688
Now that made perfect sense. And it worked perfectly in that capacity. Sorry if anyone felt put on the spot, I just wanted to understand this, so I had to ask.

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Top
 Profile  
 
 Post subject: Re: Autocrop all layers
PostPosted: Mon Jun 06, 2011 9:02 pm  (#13) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9012
Location: "Looking for my eraser" =P
I understand mahvin, i would want to know what exactly a script can do for me before i download and install it too.I do not blame you for asking. :)

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
 Post subject: Re: Autocrop all layers
PostPosted: Mon Jun 06, 2011 9:13 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Apr 23, 2010
Posts: 820
Location: not from Guildford after all
Ofnuts, you may wish to re-examine your script to ensure that it is doing what you think it is doing. The Autocrop Layer plug-in has a couple of quirks which prescribe caution.

Firstly, 'plug-in-autocrop-layer' resizes the active layer based upon the contents of the layer that has been passed as a parameter. This typically means that you will want to execute 'gimp-image-set-active-layer' before running the plug-in (assuming you wish each layer to be autocropped individually based upon its own contents). This seemingly anomalous behavior is presumably intentional, considering how 'plug-in-autocrop' behaves (cropping the image based on the single parameter layer as opposed to cropping to the entire content of the image).

Slightly more problematic (in some situations) is that 'plug-in-autocrop-layer' does not seem to recognize when there is a difference in the layer offsets of the parameter layer and the active layer (for cases where these two layers are not the same). This behavior is rarely a concern for plug-in authors -- most often autocropping is performed on a layer based upon its own contents -- but one should be aware of the problem.

I do not have access to my notes on this at the moment, but a little experimentation should demonstrate the precise behavior of the plug-in (and explain the disparity in Mahvin's results).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Profile  
 
 Post subject: Re: Autocrop all layers
PostPosted: Mon Jun 06, 2011 10:12 pm  (#15) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9012
Location: "Looking for my eraser" =P
That is odd i tried doing three layers and one object vanished all together. :lol
I made a white bg
created 3 transparent layers
created three distinct shapes on each layer.
Square on top - circle in the center - odd shape at the bottom
ran the script with all 3 layers linked and the bottom shape vanished into thin air but the boundary box was still there....And i can rotate it. :p

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
 Post subject: Re: Autocrop all layers
PostPosted: Mon Jun 06, 2011 10:15 pm  (#16) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9012
Location: "Looking for my eraser" =P
Image example to make it more clear -

Image

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
 Post subject: Re: Autocrop all layers
PostPosted: Tue Jun 07, 2011 12:30 am  (#17) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5497
Location: Somewhere in GIMP
ofnuts wrote:
Seriously, what do you mean by "doesn't work"? Do you "link" the layers before using the script?
I had the same thing happen that mahvin did.

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 

 Post subject: Re: Autocrop all layers
PostPosted: Tue Jun 07, 2011 12:42 am  (#18) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 347
Location: Wisconsin
Here is a script that should do what you want -- at least it has worked for me with multiple layers that didn't necessarily overlap.

http://theuncle2k.deviantart.com/art/Au ... -149128828

The only problem is that it does all the layers in the image.
(Yes, the script does make each layer active and then autocrops it.)

_________________
Image


Top
 Profile  
 
 Post subject: Re: Autocrop all layers
PostPosted: Tue Jun 07, 2011 3:07 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Oct 25, 2010
Posts: 1297
saulgoode wrote:
Ofnuts, you may wish to re-examine your script to ensure that it is doing what you think it is doing. The Autocrop Layer plug-in has a couple of quirks which prescribe caution.


OK, fixed in version 0.1 (on Sourceforge)

_________________
Image


Top
 Profile  
 
 Post subject: Re: Autocrop all layers
PostPosted: Tue Jun 07, 2011 11:05 am  (#20) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9012
Location: "Looking for my eraser" =P
AWESOME works perfect ofnuts! Even with 4 layers of content they autocrop very nicely. :)
Besides the Hello script that has got to be the smallest Python script i have seen to date.

Could you tell me how to edit the script if i wanted all the layers to become unlinked after the cropping takes effect?

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

* Login   * Subscribe to RSS Feed


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group