I am using Gimp 2.8.14 on Win7. I have this large layered image, about 100 layers and I need a way to find out their offset to the canvas. If anyone know a way i would appreciate to know about it. I rather not do this manually with the mouse :)
1 Answer
This assumes that you have one single image loaded in Gimp.
- Open Python-fu console (
Filters>Python-fu>Console
) Enter the two lines:
image=gimp.image_list()[0] for l in image.layers:print l.name,l.offsets
- Strike [enter] twice
- Copy/paste the result
If you want the layers in the opposite order, use
for l in reversed(image.layers):print l.name,l.offsets
If you have groups:
def dumpGroup(g):
for l in g.layers:
if isinstance(l,gimp.GroupLayer):
dumpGroup(l)
else:
print l.name,l.offsets
image=gimp.image_list()[0]
dumpGroup(image)
-
Ahh great a built in python console :) I should get this to work now, only problem is that the code in your example did not list the children layers just the root or topmost layers. (the image is built with 5 root nodes who each got numerous children layers) Commented Apr 3, 2017 at 11:02
-
Also doable, but not with a one-liner. You would have to define a function, and call it recursively... Will check during lunch break.– xenoidCommented Apr 3, 2017 at 11:07
-
Layer → Layer Boundary Size.X Offset; Y Offset
These coordinates are relative to the layer, not to the image. They are used to move a frame that determines which part of the layer content will be selected for the resized layer