It is currently Sat Feb 06, 2016 1:23 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



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

Joined: May 22, 2008
Posts: 6759
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
Don't look back. Something might be gaining on you. - Satchel Paige
Image


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
Administrator
User avatar

Joined: May 22, 2008
Posts: 6759
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
Don't look back. Something might be gaining on you. - Satchel Paige
Image


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: 203
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: 13989
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: 4782
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
Administrator
User avatar

Joined: May 22, 2008
Posts: 6759
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
Don't look back. Something might be gaining on you. - Satchel Paige
Image


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: 203
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
Administrator
User avatar

Joined: May 22, 2008
Posts: 6759
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
Don't look back. Something might be gaining on you. - Satchel Paige
Image


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Batch script: add a predefined image layer, set layer mode, export.

7

No new posts Attachment(s) Image to Layer Boundary Size

14

No new posts Scale Layer to Image Size

8

No new posts Script-fu add a layer from one image to another as a layer?

5

No new posts Layer to Image Size doesn't work

2


cron

* Login  



Powered by phpBB3 © phpBB Group