It is currently Sat Jul 20, 2024 8:24 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Scale Layer to Image Size
PostPosted: Mon May 14, 2012 1:41 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: May 14, 2012
Posts: 10
Image

GIMP 2.8 Python Plug-in.
This plug-in scales the contents of the layer (or layer group) to image size.

Installation:
1. Close GIMP if it is open.
2. Extract "scale-layer-to-image-size.py" from zip archive to the ".../.gimp-2.8/plug-ins" directory.
3. Run GIMP. The plug-in should appear under the menu: "Layer > Scale Layer to Image Size". Don't forget to make the plug-in executable.

Download:
Download from my deviantart page:
slybug.deviantart.com

Tested with GIMP 2.8.
I hope this plug-in will be useful for someone else.

Version History:
v1.3 (01.06.2012)
- Added support for working with layer groups.
- To the two types of scaling added three more.
- Added "Align to image center" option.
- Fixed bug in "Crop to Image Size" which leads to cropping of the whole image, and not the selected layer.
v1.2 (19.05.2012)
- Added "Crop to Image Size" option.
- The value "Addition" is now measured as a percentage (%).
- Some code improvements.
v1.0 (13.05.2012)
- Initial release.

My other plugins:
Create Layer Mask from...
Duplicate to another Image
Layer via Copy/Cut


Last edited by slybug on Mon Apr 22, 2013 8:40 am, edited 4 times in total.

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: Scale Layer to Image Size
PostPosted: Mon May 14, 2012 1:58 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I guess it doesn't work in gimp-2.6.12. I downloaded and added it to my plug-in folder. It shows under layers but when I click it no dialog comes up. Do I have to have more than one layer or make a selection?

_________________
Image


Top
 Post subject: Re: Scale Layer to Image Size
PostPosted: Mon May 14, 2012 2:00 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7316
Location: Göteborg at last!
Something I could have done with a number of times. When my internet connection is running a bit faster I'll download this one. Thank you.


Top
 Post subject: Re: Scale Layer to Image Size
PostPosted: Mon May 14, 2012 2:14 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 14, 2012
Posts: 10
molly wrote:
I guess it doesn't work in gimp-2.6.12. I downloaded and added it to my plug-in folder. It shows under layers but when I click it no dialog comes up. Do I have to have more than one layer or make a selection?

Sorry, this script most probably does not work in gimp-2.6.12. You may have few layers in a composition, but the script can be applied only to the selected layer.


Top
 Post subject: Re: Scale Layer to Image Size
PostPosted: Mon May 14, 2012 2:23 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4757
slybug wrote:
molly wrote:
I guess it doesn't work in gimp-2.6.12. I downloaded and added it to my plug-in folder. It shows under layers but when I click it no dialog comes up. Do I have to have more than one layer or make a selection?

Sorry, this script most probably does not work in gimp-2.6.12. You may have few layers in a composition, but the script can be applied only to the selected layer.

The reason is that you use pdb.gimp_context_set_interpolation() which is new in 2.8.

IMHO this isn't really useful... There is a default interpolation that you can use.

_________________
Image


Top
 Post subject: Re: Scale Layer to Image Size
PostPosted: Mon May 14, 2012 2:38 pm  (#6) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
thank you guys

_________________
Image


Top
 Post subject: Re: Scale Layer to Image Size
PostPosted: Fri Jun 01, 2012 9:11 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: May 14, 2012
Posts: 10
v1.3 (01.06.2012)
Added support for working with layer groups.


Top
 Post subject: Re: Scale Layer to Image Size
PostPosted: Fri Jun 01, 2012 5:18 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14715
Location: USA
Thanks Slybug. :)

_________________
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: Scale Layer to Image Size
PostPosted: Sun Jun 03, 2012 10:38 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: May 14, 2012
Posts: 10
Rod wrote:
Thanks Slybug. :)

You are welcome Rod :)


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Cannot seem to scale the print size

4

No new posts Cannot seem to scale the print size

1

No new posts Attachment(s) Scale image

6

No new posts Reducing layer size without loosing quality?

2

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

2



* Login  



Powered by phpBB3 © phpBB Group