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

Anyway to add multiple Guides at once?

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.

4 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Anyway to add multiple Guides at once? DJ 27 May 05:34
  Anyway to add multiple Guides at once? David Gowers 27 May 12:09
   Anyway to add multiple Guides at once? Niels Giesen 29 May 12:03
mailman.1.1243450803.4192.g... 07 Oct 20:20
  Anyway to add multiple Guides at once D.Jones (aka) Capnhud 29 May 09:31
DJ
2009-05-27 05:34:37 UTC (over 15 years ago)

Anyway to add multiple Guides at once?

Hi Gimp-user,

Didn't see it in the manual, but was wondering if there is a short-cut to adding multiple Guides at once (ie., a comma-separated list)?

I have about 15+ Guides to add. I setup a keyboard shortcut and entered them one at a time.

Thank you.

David Gowers
2009-05-27 12:09:23 UTC (over 15 years ago)

Anyway to add multiple Guides at once?

On Wed, May 27, 2009 at 1:04 PM, DJ wrote:

Hi Gimp-user,

Didn't see it in the manual, but was wondering if there is a short-cut to adding multiple Guides at once (ie., a comma-separated list)?

It seems difficult to imagine anything faster than the Gimp-python console for this:

image = gimp.image_list()[0] # get the latest loaded image

for y in (10,20,60,80, 120, 140, 260, 280): pdb.gimp_image_add_vguide (image, y)

It should be possible to make a Script-Fu which accepts a list of coordinates (space separated) and does something similar to the loop above.
However, I don't know how; I only know how to implement that in Python:

# assuming 'coords' is the string parameter containing space-separated coordinates
realcoords = [int(v) for v in coords.split()] for y in realcoords:
pdb.gimp_image_add_vguide (image, y)

Adding an option to choose between adding h and v guides should also be easy.

David

D.Jones (aka) Capnhud
2009-05-29 09:31:39 UTC (over 15 years ago)

Anyway to add multiple Guides at once

-
, DJ wrote:

Didn't see it in the manual, but was wondering if there is a short-cut to adding multiple Guides at once (ie., a comma-separated list)?

It seems difficult to imagine anything faster than the Gimp-python console for this:

image = gimp.image_list()[0] # get the latest loaded image

for y in (10,20,60,80, 120, 140, 260, 280): pdb.gimp_image_add_vguide (image, y)

It should be possible to make a Script-Fu which accepts a list of coordinates (space separated) and does something similar to the loop above.
However, I don't know how; I only know how to implement that in Python:

# assuming 'coords' is the string parameter containing space-separated coordinates
realcoords = [int(v) for v in coords.split()] for y in realcoords:
pdb.gimp_image_add_vguide (image, y)

Adding an option to choose between adding h and v guides should also be easy.

David There is a gimp plugin called multiple guides (python) and appears to be in german but it will allow you to add multiple guides. I tried to access the link but it seems that gimpl plugin registry is down at the moment.

------------------------------

Niels Giesen
2009-05-29 12:03:36 UTC (over 15 years ago)

Anyway to add multiple Guides at once?

latest added image in script-fu is

(vector-ref (cadr (gimp-image-list)) 0)

so a one-off would be

(map (lambda (guide)
(gimp-image-add-hguide (vector-ref (cadr (gimp-image-list)) 0) guide)) '(10 230))

I do not know how to get the /active/ image though....

... but here's a script

http://niels.kicks-ass.org/public/gimp/script-fu-add-guides.scm

On Wed, May 27, 2009 at 12:09 PM, David Gowers wrote:

On Wed, May 27, 2009 at 1:04 PM, DJ wrote:

Hi Gimp-user,

Didn't see it in the manual, but was wondering if there is a short-cut to adding multiple Guides at once (ie., a comma-separated list)?

It seems difficult to imagine anything faster than the Gimp-python console for this:

image = gimp.image_list()[0] # get the latest loaded image

for y in (10,20,60,80, 120, 140, 260, 280):    pdb.gimp_image_add_vguide (image, y)

It should be possible to make a Script-Fu which accepts a list of coordinates (space separated) and does something similar to the loop above.
However, I don't know how; I only know how to implement that in Python:

# assuming 'coords' is the string parameter containing space-separated coordinates
realcoords = [int(v) for v in coords.split()] for y in realcoords:
   pdb.gimp_image_add_vguide (image, y)

Adding an option to choose between adding h and v guides should also be easy.

David _______________________________________________ Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user