It is currently 07 Jul 2020, 02:41

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

getting layers of an image in python fu script

Share your Python Fu Scripts/plug-ins for GIMP here
Post Reply
trandoductin
Forum Member

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.
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.
0


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 22 guests