我在 Win7 上使用 Gimp 2.8.14。我有这个大的分层图像,大约 100 层,我需要一种方法来找出它们对画布的偏移量。如果有人知道一种方法,我将不胜感激。我宁愿不使用鼠标手动执行此操作:)
这假设您在 Gimp 中加载了一张图像。
Filters>Python-fu>Console
)输入两行:
image=gimp.image_list()[0]
for l in image.layers:print l.name,l.offsets
Run Code Online (Sandbox Code Playgroud)如果您希望图层的顺序相反,请使用
for l in reversed(image.layers):print l.name,l.offsets
Run Code Online (Sandbox Code Playgroud)
如果您有群组:
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)
Run Code Online (Sandbox Code Playgroud)