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

Image history access from python

This discussion is connected to the gimp-developer-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.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Image history access from python Paco Garcia 15 Jan 09:42
  Image history access from python Joao S. O. Bueno 15 Jan 17:50
Paco Garcia
2014-01-15 09:42:07 UTC (about 10 years ago)

Image history access from python

hi, it would be very helpful to have access to the history of each image object from python, at least to the coordinates where the user has pressed, for example in two of my scripts to take coordinates from the user I force them to create paths of only use the coordinates of two nodes, if I had access to the user history clicks only have to access the last two clicks, for example:
img = gimp.image_list () [0]
h = img.History
x1, y1 = h.mousePos [h.Length-1]
x2, y2 = h.mousePos [h.Length]
Or something like this
Currently forced the user to create paths which then has to clear, the examples are:
http://www.arakne.es/en/dessign/gimp-python-plugin-rotate-image-using-paths/ http://www.arakne.es/en/dessign/gimp-script-stitch-layers/ Paco Garca

Joao S. O. Bueno
2014-01-15 17:50:52 UTC (about 10 years ago)

Image history access from python

Hi Pacco-

yes, subverting Path creation for getting user coordinates is currently the only way GIMP plug-ins have to get them. (You could however, clear the paths on the plug-in call if in your workflow clearing them become a burden)

It is interesting to note that even the C plug-ins that ship with GIMP can only get image coordinates by re-creating an image preview inside their window (that could be done from Python plug-ins as well). But this is done by old-style plug-ins - new style plug-ins, using GEGL, don have much of an UI definition yet, besides automatically generated UIs from the GEGL-operation parameters.

I had proposed a couple of times in the past (distant past by now) to have a way to call-back plug-ins upon user actions on the images. Such a discussion should pop back anytime soon, since on-dialog image previews for plug-ins are now a thing of the past.

I don't think your proposal as is should "fly" though - I can't see how to define
an image "click" from within a plug-in like you do. A "click" using what tool? What settings?

Maybe a "plug-in tool" that would give a plug-in (or Gegl-op ) access to all stroke parameters, more or less as specified in the "ink markup language" would be a
more solid approach for GIMP (http://www.w3.org/TR/InkML/) in the foreseable future.

js
-> wrote:

hi, it would be very helpful to have access to the history of each image object from python, at least to the coordinates where the user has pressed, for example in two of my scripts to take coordinates from the user I force them to create paths of only use the coordinates of two nodes, if I had access to the user history clicks only have to access the last two clicks, for example:
img = gimp.image_list () [0]
h = img.History
x1, y1 = h.mousePos [h.Length-1]
x2, y2 = h.mousePos [h.Length]
Or something like this
Currently forced the user to create paths which then has to clear, the examples are:
http://www.arakne.es/en/dessign/gimp-python-plugin-rotate-image-using-paths/ http://www.arakne.es/en/dessign/gimp-script-stitch-layers/ Paco García
_______________________________________________ gimp-developer-list mailing list
List address: gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list