Switch to full style
Ask all general Gimp related questions here
Post a reply

how to get layer offsets from the main layer?

Tue Jul 18, 2023 3:40 am

GIMP Version: 2.10.18
Operating System: Linux
OS Version: Ubuntu
GIMP Experience: Intermediate Level



So I have this big image (2000x1000px) with hundreds of smaller layers. I need to get the offsets automatically, somehow.

When I rightclick on the "Layer Attributes" I can see the offset values (Offset X & Offset Y). From here I could get the values, but I really don't want to do this manually hundred times. :(

Is it possible to run some script and save that data to either the layername or a txt-file. The format doesn't really matter.

Re: how to get layer offsets from the main layer?

Tue Jul 18, 2023 6:02 am

You could use ImageMagick (IM), Using linux ? then probably still on IM6. Export your layered image to a tif file, then to list the offsets in a text file. (1)

Code:
identify -format ", %X %Y"  temp.tif > list.txt


offset.jpg
offset.jpg (159.78 KiB) Viewed 509 times


If you get the IM7 linux magick appimage from https://imagemagick.org/script/download.php then you can use Gimp xcf format similar syntax. (2)
Using kubuntu 22.04

Re: how to get layer offsets from the main layer?

Tue Jul 18, 2023 1:27 pm

:tyspin
Thanks! I can work with this. Just need to make some scripts.

Re: how to get layer offsets from the main layer?

Wed Jul 19, 2023 1:52 am

I don't know why you want to get just the offsets. If you need to get positions of things in an image, a quick and easy way is to draw a polygonal path. You then have API to retrieve the path anchors coordinates. I even have a script to export the path points coordinates in a CSV.
Post a reply