It is currently Tue Apr 16, 2024 6:12 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: a scale multiple layers script
PostPosted: Thu Apr 18, 2013 7:13 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I need a script to scale multiple layers to the same size all at once.
I thought i saw one here before but using search i could not locate it.

Does anyone know how to write one to do this or is there one out there i missed?

Thanks folks.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: a scale multiple layers script
PostPosted: Thu Apr 18, 2013 7:49 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4734
If the layers are chained and you use the scale tool, they will be scaled together.

Yet another "tell me hat you need, and I'll show you how to do without it" :)

_________________
Image


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Thu Apr 18, 2013 8:51 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Rod you could try this

Menu location layer/Scale Linked Layers
Image

Attachment:
Scale Linked Layers.scm [2.12 KiB]
Downloaded 317 times

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Thu Apr 18, 2013 10:34 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Graechan wrote:
Rod you could try this

Menu location layer/Scale Linked Layers
Image

Attachment:
Scale Linked Layers.scm


Sweet! You even added scale from center.
Thanks Graechan. :)

Ofnuts thanks for the information on scaling linked layers.I learn something new in Gimp every day. :bigthup

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Thu Apr 18, 2013 10:51 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Rod I made a mistake that I did not notice until after I posted I spelled RGB* RBG* in the menu if your copy has this error you can re download or fix
Quote:
(script-fu-register "script-fu-scale-linked-layers"
"Scale Linked Layers"
"Will Scale Linked Layers"
"Graechan"
"Graechan - http://gimpchat.com"
"April 2013"
"RGB* GRAY* INDEXED*"

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Thu Apr 18, 2013 10:55 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Graechan wrote:
Rod I made a mistake that I did not notice until after I posted I spelled RGB* RBG* in the menu if your copy has this error you can re download or fix
Quote:
(script-fu-register "script-fu-scale-linked-layers"
"Scale Linked Layers"
"Will Scale Linked Layers"
"Graechan"
"Graechan - http://gimpchat.com"
"April 2013"
"RGB* GRAY* INDEXED*"


Thanks for letting me know Graechan.I ran the script on a RGB image before fixing and it ran fine. :bigthup
Awesome script and it will be very handy.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Thu Apr 18, 2013 11:34 pm  (#7) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
onuts suggestion to just link the layers and scale did not work in my gimp, as only the active layer was scaled?

maybe I did it wrong but I don't think everything done on a linked layer transfers to the other linked layers

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Fri Apr 19, 2013 12:40 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Graechan wrote:
onuts suggestion to just link the layers and scale did not work in my gimp, as only the active layer was scaled?

maybe I did it wrong but I don't think everything done on a linked layer transfers to the other linked layers


I tried it in Gimp-2.8.4 (Parthas install) and it worked for me. :)
I made one layer, duplicated it 4 times and linked 4 layers and scaled proportionately and it scaled all the linked layers.I love the script you wrote better though Graechan as it scales from center. :bigthup
I don't know why Gimp doesn't have this setting default already. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Fri Apr 19, 2013 1:37 am  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4734
Rod wrote:
Ofnuts thanks for the information on scaling linked layers.I learn something new in Gimp every day. :bigthup

This actually applies to all geometric transforms (rotate/scale/shear/perspective/flip...) and applies to channels and paths that are linked as well... (so you can keep a layer, a channel, and a path in sync...).

_________________
Image


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Fri Apr 19, 2013 1:56 am  (#10) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Strangly it only worked with the scale tool but not with the scale-layer plugin in 2.8 2 and 2.8.4 windows

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Sat Apr 20, 2013 7:40 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Graechan wrote:
Strangly it only worked with the scale tool but not with the scale-layer plugin in 2.8 2 and 2.8.4 windows


I am thinking it must be your version Graechan as it worked for me in Parthas version.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: a scale multiple layers script
PostPosted: Tue Sep 15, 2015 5:19 pm  (#12) 
Offline
GimpChat Member

Joined: Sep 15, 2015
Posts: 5
Graechan wrote:
Rod you could try this

Menu location layer/Scale Linked Layers
Attachment:
The attachment Scale Linked Layers.scm is no longer available



Is there a way to remove the Linked part of this? I am working with about 2000 layers and I dont want to have to link each and every layer individually since that is tedious....

Before I finished typing this I looked at the code and figured out I just had to remove an if conditional to accomplish this I shall share the modified file (hopefully the credit change I made is appropriate if not let me know).

EDIT: I found a bug that I need help fixing since I am not familiar with the syntax of script-fu (im really only familiar with c++ and java so I was able to figure out the above but not much else). I was scaling all of the layers up to 2000 px by 1 px and the one layer that already had that width messed up and increased to 3000 px by 1 px instead of being skipped since it was already the correct size. I assume I just need to add an if conditional into the while loop that says "if (get-width = new-width) then (if (get-height != new-height) then (scale-to-new-height)) else (if (get-height != new-height) then (scale-to-new-height-and-new-width) else (scale-to-new-width). Thanks for any help


Attachments:
Scale Layers.scm [2.11 KiB]
Downloaded 80 times


Last edited by opakedragon on Tue Sep 15, 2015 6:00 pm, edited 1 time in total.
Top
 Post subject: Re: a scale multiple layers script
PostPosted: Tue Sep 15, 2015 5:23 pm  (#13) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
opakedragon wrote:
Graechan wrote:
Rod you could try this

Menu location layer/Scale Linked Layers
Attachment:
Scale Linked Layers.scm



Is there a way to remove the Linked part of this? I am working with about 2000 layers and I dont want to have to link each and every layer individually since that is tedious....

Before I finished typing this I looked at the code and figured out I just had to remove an if conditional to accomplish this I shall share the modified file (hopefully the credit change I made is appropriate if not let me know).


You can try holding down shift key and click the link to turn them all on or off.

_________________
TinT


Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Multiple Layers Attributes/Mode .scm Updated

0

No new posts Attachment(s) Scale image

6

No new posts Scale Tool in Gimp 2.10.10

7

No new posts How do I stretch a selection (not scale)

4

No new posts Cannot seem to scale the print size

1



* Login  



Powered by phpBB3 © phpBB Group