It is currently 21 Feb 2018, 08:57

GIMP Python Fu Scriptsgetting layers of an image in python fu script (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
Post Reply
User avatar
trandoductin

Forum Member
View: Showcase | Slideshow
Topic Posts: 1/1
Posts: 189
Joined: 26 Sep 2016, 00:21
Cash on hand: 317.58 GLP
Gender: Guy
Location: Canada
Website: https://gimplearn.net
x 7
Contact:
Canada

getting layers of an image in python fu script

Post#1 by trandoductin » 01 Oct 2016, 23:03


just here for future reference:
This is how you get all layers that belong to an image.

Code: Select all

image.layers
your can loop through an image by using

Code: Select all

for layer in image.layers:
		#do whatever here with layer
or if you're planning to save layers into a separate list so that if you add layers while working through them, the list doesn't grow or shrink on you, you can use

Code: Select all

layers = list(image.layers)
then just loop through layers that way if you add layer(s) to image, the layers doesn't change on you, at least that's what i assumed (that image.layers would be changed if you added layers on the fly.
0 x



T.
please don't message me, message tim(admin) instead as I am tim(admin). I don't check this account very often.
To message tim(admin), click here. Thanks.

Registered members enjoy ads-free content
Post Reply

Last 20 Members Who Visited This Topic

User avatar tim (1), User avatar gnerd (1)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: tim
2: gnerd
3: oldmangrumpy
4: animicule
5: Conbagui
6: Pat625
7: Issabella

Who is online

Users browsing this forum: No registered users and 2 guests