RSS/Atom feed Twitter
Site is read-only, email is disabled

Need a script to output position of images within image.

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2012-05-31 00:44:06 UTC (over 12 years ago)
postings
20

Need a script to output position of images within image.

Hello,

I created a jigsaw puzzle from an image. All the pieces exist in different layer.

Is there a way to get the position of the pieces (a script or a menu command)? I realize I could use the ruler, however, I would like something that would be more exact and less tedious.

Thanks, Stephen

Chris Mohler
2012-05-31 00:58:45 UTC (over 12 years ago)

Need a script to output position of images within image.

On Wed, May 30, 2012 at 7:44 PM, stephen wrote:

I created a jigsaw puzzle from an image.  All the pieces exist in different layer.

Is there a way to get the position of the pieces (a script or a menu command)?  I realize I could use the ruler, however, I would like something that would be more exact and less tedious.

With only one image open, from the python-fu console:

img = gimp.image_list()[0]

for layer in img.layers: print layer.name, layer.offsets

Chris

Chris Mohler
2012-05-31 01:02:43 UTC (over 12 years ago)

Need a script to output position of images within image.

On Wed, May 30, 2012 at 7:58 PM, Chris Mohler wrote:

I created a jigsaw puzzle from an image.  All the pieces exist in different layer.

Is there a way to get the position of the pieces (a script or a menu command)?  I realize I could use the ruler, however, I would like something that would be more exact and less tedious.

With only one image open, from the python-fu console:

img = gimp.image_list()[0]

for layer in img.layers:    print layer.name, layer.offsets

I was curious to see how the forum has hooking to the mailing list these days, and I'm sad to report that it munged the spacing on that psuedo-code. You'd be better off subscribing to the mailing list directly. Anyway, it should be like:

img = gimp.image_list()[0]

for layer in img.layers: print layer.name, layer.offsets

Where means indent via Tab key or spaces.

Chris

Chris Mohler
2012-05-31 01:04:49 UTC (over 12 years ago)

Need a script to output position of images within image.

Well, I give up. The forum ate that too.

Chris

2012-05-31 01:08:43 UTC (over 12 years ago)
postings
20

Need a script to output position of images within image.

On Wed, May 30, 2012 at 7:44 PM, stephen wrote:

I created a jigsaw puzzle from an image.  All the pieces exist in different layer.

Is there a way to get the position of the pieces (a script or a menu command)?  I realize I could use the ruler, however, I would like something that would be more exact and less tedious.

With only one image open, from the python-fu console:

img = gimp.image_list()[0]

for layer in img.layers:
print layer.name, layer.offsets

Chris

Fantastic! that works.

Where is a good place to learn more about the functions that are accessible through scripts?

Stephen

Chris Mohler
2012-05-31 01:09:55 UTC (over 12 years ago)

Need a script to output position of images within image.

On Wed, May 30, 2012 at 8:08 PM, stephen wrote:

Where is a good place to learn more about the functions that are accessible through scripts?

Check Help->Procedure Browser

Chris

2012-05-31 01:11:21 UTC (over 12 years ago)
postings
20

Need a script to output position of images within image.

On Wed, May 30, 2012 at 8:08 PM, stephen wrote:

Where is a good place to learn more about the functions that are accessible through scripts?

Check Help->Procedure Browser

Chris

Thanks, I'll do that.

Chris Mohler
2012-05-31 01:13:53 UTC (over 12 years ago)

Need a script to output position of images within image.

On Wed, May 30, 2012 at 8:11 PM, stephen wrote:

Thanks, I'll do that.

Also you can do stuff like this in the console:

dir(gimp)

img = gimp.image_list()[0] dir(img)

etc.

Chris

2012-05-31 01:27:30 UTC (over 12 years ago)
postings
20

Need a script to output position of images within image.

On Wed, May 30, 2012 at 8:11 PM, stephen wrote:

Thanks, I'll do that.

Also you can do stuff like this in the console:

dir(gimp)

img = gimp.image_list()[0]
dir(img)

etc.

Chris

Thanks.

Kevin Cozens
2012-05-31 16:35:42 UTC (over 12 years ago)

Need a script to output position of images within image.

On 12-05-30 08:44 PM, stephen wrote:

I created a jigsaw puzzle from an image. All the pieces exist in different layer.

Is there a way to get the position of the pieces (a script or a menu command)?

I'm not sure anything exists to do that but you could write a script. If you autocrop each layer you could then get the layer offset for each piece (ie. layer).