It is currently Thu Mar 28, 2024 6:10 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 11:32 am  (#1) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
If there is one somewhere, I haven't found it.

I would like one that does all of the layers. Thanks.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


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: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 3:29 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 11, 2010
Posts: 545
Location: In the mini-chat, saying silly things
Only thing I can think of what you can do now is change the canvas size by 1 pixel and then in the drop down menu choose resize layers - all layers. Then go back to canvas size and repeat these steps but making the canvas size the original size again.

_________________
Image


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 3:33 pm  (#3) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Well you can right-click a layer and do Layer to Image size, but it would be nice to have a script that does all of the layers at once.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 6:28 pm  (#4) 
Offline
GimpChat Member

Joined: Apr 11, 2010
Posts: 545
Location: In the mini-chat, saying silly things
I agree, that takes a lot of time. It's a shame that "Image - Canvas size - Resize layers - All Layers" only works after you've changed canvas size.

_________________
Image


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 7:44 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Apr 13, 2010
Posts: 244
Here you are:

Save it to your scripts folder, refresh your script (Filters > Script-Fu > Refresh Scripts) and you can find it under Layers > All Layers to Image Size. Works on RGB, Grayscale, and Indexed image types.


; GIMP - The GNU Image Manipulation Program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
;
;
;
; Script can be found under Layer > All Layers to Image Size


; Define the Function

(define (fp-script-fu-all-layers-to-image-size
   img      
            drawable)


(gimp-context-push)
(gimp-image-undo-group-start img)

(map (lambda (x) (gimp-layer-resize-to-image-size x)) (vector->list (cadr (gimp-image-get-layers img))))

(gimp-image-undo-group-end img)

(gimp-context-pop)

(gimp-displays-flush)


)

(script-fu-register "fp-script-fu-all-layers-to-image-size"
  "<Image>/Layer/All Layers to Image Size"
  "Resize all the layers in an image to the same size as the image."
  "Art Wade"
  "Art Wade"
  "May 24, 2010"
  "*"
  SF-IMAGE          "Image" 0
  SF-DRAWABLE       "Drawable" 0

)

_________________
I'd rate you as an upper-middle-lower-mod with pro-novice-inter tendencies.....and a twist of lime! Of course, my rating scale is completely objectively subjective, but ALWAYS consistently inconsistent.


Last edited by fencepost on Mon May 24, 2010 8:30 pm, edited 1 time in total.

Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 8:10 pm  (#6) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
wow that was fast FP. O will be glad..... me too in fact.....

_________________
Image


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 8:31 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
Woot, fencepost to the rescue again!


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 8:47 pm  (#8) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Wow! It even works! Slick!!

A big thank you, Art! That really is nice. Especially when you have a large animation with a background and want to Optimize (Difference). Every layer is cropped to the differences in the animation.

:yes :hi5

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Tue May 25, 2010 11:42 am  (#9) 
Offline
Script Coder
User avatar

Joined: Apr 13, 2010
Posts: 244
You're welcome, everyone! Took about 5 minutes. Those are the scripts I like! :hehe

Oregonian wrote:
It even works!


Um, Excuse me.....you thought otherwise? :rofl

_________________
I'd rate you as an upper-middle-lower-mod with pro-novice-inter tendencies.....and a twist of lime! Of course, my rating scale is completely objectively subjective, but ALWAYS consistently inconsistent.


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Tue May 25, 2010 12:03 pm  (#10) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
fencepost wrote:
Um, Excuse me.....you thought otherwise? :rofl


Moi? :cu Non!

Just have to pull your leg a little when I get a chance. :-D

When you put it into your scripts gallery, would you please put a link to the script? Thanks.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Tue May 25, 2010 11:27 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
sweet! ... thx fencepost you rock! =)

_________________
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: Request for Layer to Image Size layer script
PostPosted: Wed May 26, 2010 8:17 am  (#12) 
Offline
Script Coder
User avatar

Joined: Apr 13, 2010
Posts: 244
Oregonian wrote:
When you put it into your scripts gallery, would you please put a link to the script? Thanks.


Will do. But it may be awhile.....I've fallen in love with my guitar again and she's taking up all my time! ;)

Thanks for the compliments everyone. Glad to be able to assist.

_________________
I'd rate you as an upper-middle-lower-mod with pro-novice-inter tendencies.....and a twist of lime! Of course, my rating scale is completely objectively subjective, but ALWAYS consistently inconsistent.


Top
 Post subject: Re: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Wed May 26, 2010 8:23 am  (#13) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
FP,
I am just in the process of adding your new script to the tutorial I am working on. gotta baptize it......lol

_________________
Image


Top
 Post subject: Re: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Sun Aug 15, 2010 8:45 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
Sweet script! This is something I have wanted, but never thought of asking about! Way to go!!

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon Aug 16, 2010 5:15 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
fencepost wrote:

Will do. But it may be awhile.....I've fallen in love with my guitar again and she's taking up all my time! ;)

Thanks for the compliments everyone. Glad to be able to assist.


*my reply is off Topic somewhat*

I started out with my Ibanez metalic black 6 string shredder, but the first day i bought Jasmine (my acoustic) i fell in love too. There is no better feeling than sitting out on the porch and picking out a good ole fashioned country song. =)
Which do you prefer to play? Maybe we can trade tabs sometime?

_________________
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: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Tue Jun 03, 2014 6:13 pm  (#16) 
Offline
GimpChat Member

Joined: Jun 03, 2014
Posts: 6
I registered just to say thank you! This script rox!


Top
 Post subject: Re: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Tue Jun 03, 2014 6:49 pm  (#17) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
You might want to check out the Multiple Layer Actions script. It performs the All layers to Image Size action, as well as several other useful functions. I find it to be a big time saver.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Wed Jun 04, 2014 1:31 am  (#18) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4726
Without a script, in two operations:

- Image>Canvas size: increase one side by 1, and "resize all layers"
- Image>Canvas size: decrease same side by 1, and "resize all layers"

_________________
Image


Top
 Post subject: Re: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Wed Jun 04, 2014 1:34 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
ofnuts wrote:
Without a script, in two operations:

- Image>Canvas size: increase one side by 1, and "resize all layers"
- Image>Canvas size: decrease same side by 1, and "resize all layers"

you rebel :rofl


Top
 Post subject: Re: [SOLVED] Request for Layer to Image Size layer script
PostPosted: Wed Jun 04, 2014 1:40 am  (#20) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Yeah, who needs this script when you can do it with another script, with double the effort? :lol

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Adding a image as a layer, moving layer, and then flattening

2

No new posts How do I script a new white layer to the bottom of the layer stack

7

No new posts Reducing layer size without loosing quality?

2

No new posts Shortcuts to 2.10 documentation re: Layer & Layer-group modes

0

No new posts Add layer mask hides the entire layer

3



* Login  



Powered by phpBB3 © phpBB Group