It is currently Fri Jul 25, 2014 11:01 am


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 12:32 pm  (#1) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5898
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
There are two major products to come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.

Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Profile  
 
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 4:29 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 11, 2010
Posts: 554
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
 Profile  
 
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 4:33 pm  (#3) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5898
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
There are two major products to come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.

Image


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

Joined: Apr 11, 2010
Posts: 554
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
 Profile  
 
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Mon May 24, 2010 8: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 9:30 pm, edited 1 time in total.

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

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

_________________
Image


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

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


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

Joined: May 22, 2008
Posts: 5898
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
There are two major products to come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.

Image


Top
 Profile  
 
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Tue May 25, 2010 12:42 pm  (#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
 Profile  
 
 Post subject: Re: Request for Layer to Image Size layer script
PostPosted: Tue May 25, 2010 1:03 pm  (#10) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5898
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
There are two major products to come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.

Image


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Wallace and 4 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 Gimp Chat's RSS Feed    * Subscribe to Gimp Chat's Tutorial Feed    * Subscribe to Gimp Chat's G'MIC Feed


Powered by phpBB3 © phpBB Group