Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
macros vs script-fu vs python-fu
#1
Absolute Beginner here, to python & to scripting/macroing/extending GIMP.

I had a vague remembrance that GIMP is "scriptable", and the term "macro" came to my  mind.

After considerable googling, I've about decided that "macro" is an inaccurate term, and "extending GIMP" is the correct terminology (although I tend to think of "extending" as adding new features more then simply automating the features that already exist).

I've also about decided that "script-fu" and "python-fu" are "the" automating options; I'm unsure if either is built-in, but I didn't notice these options in my Gimp's "Filter" menu until I did, on my Debian box, "aptitude install gimp-python". Not saying they weren't there; I just didn't know to look for them until after I added gimp-python to my computer.

So my first question (with more to come under different posts): Am I getting close to understanding the terminology/concepts for automating steps in GIMP? To give you an idea of where I'm trying to head, I just added a bunch of numbered labels to 28 people in a photo:

[Image: 0?ui=2&ik=02ec0251fe&attid=0.2&permmsgid..._jmw7lnq11]

I did this manually by creating 28 layer groups, one for each label, and then on one layer drawing an ellipse and bucket-filling it, and then creating a text layer centered on the white ellipse. Afterward I realized that this repetitive process could probably be automated. My next questions will tackle various aspects of this task, but first I just want to make sure I'm understanding the concepts/terminology.

Thanks!

--
Kent
Reply
#2
There are no "macros" in Gimp, in the usual meaning of the term (more or less: recording you actions and replaying them).

Gimp is designed to be extensible with scripts and plugins. These two are technically different, scripts are in TinyScheme (aka script-fu) and interpreted by the built-in script interpreter. Plugins are independent processes written in potentially any language,  even if in practice you are restricted to languages for which there is  a Gimp interface. For a long time this meant only C, but since 2.6 there is also an interface for Python. But to  muddy up things, most python "plugins" are written like scripts: they are mostly glue between calls to the Gimp API, like the script-fu ones, so you will hear about Python scripts (but they are really plugins).

IMHO, in 2018, the only merits of script-fu are historical: this was a small footprint interpreter required by the memory-constrained computers of the 90s. But now we have plenty of RAM and Python is more common, easier to write and much more powerful.

PS: Your image link doesn't work....
Reply
#3
Thank you for your response. That helps nail things down a bit.

As to the image: Odd, I copy/pasted it in, wondering if that would work, and it looked like it did. It even shows up later when I look at my post on the non-compose-a-post page.

This actual weblink should work: http://goshen.acu.edu/westk/Team55Students.png

I'm guessing the original attempt linked it to a local file instead of actually inserting the image into the post, which is why it works on my computer.
Reply
#4
(10-06-2018, 08:22 PM)DebianFanatic Wrote: Absolute Beginner here, to python & to scripting/macroing/extending GIMP.
...snip...
I had a vague remembrance that GIMP is "scriptable", and the term "macro" came to my  mind.added a bunch of numbered labels to 28 people in a photo:
...snip...
I realized that this repetitive process could probably be automated. My next questions will tackle various aspects of this task, but first I just want to make sure I'm understanding the concepts/terminology.

--
Kent

While I feel that python and particularly script-fu is akin to Sanskrit for the average user and some sort of macro recording would be welcome, there are often scripts that you can inspect, learn from or maybe adapt for your own use.

You could start with this one, RMA_label_points.scm near the top of the list here: http://silent9.com/incoming/scripts/

Which uses a path and puts a label at the path nodes (control points)

Might look like this.

[Image: nVQMVYg.jpg]
Reply
#5
There is also ofn-points-sequence (all in python of course)(hint, hint)
Reply
#6
Lightbulb 
Hi,

About the concept/terminology "macro": 
In 2018, DebianFanatic Wrote:GIMP is "scriptable", and the term "macro" came to my mind
Ofnuts Wrote:recording (...) actions and replaying them
rich2005 Wrote:some sort of macro recording would be welcome

In 2021, according to the Gimp 3.x roadmap, the feature "Script recording and playback" has the status "No".  Angry

On the other hand, macro belongs also to the Script-Fu language.  Cool

In the basic library supplied with Gimp 2.10.28,
C:\Program Files\GIMP 2\share\gimp\2.0\scripts\script-fu.init defines some macros such as the iterator do with the constructor macro
referenced in the Revised4 Report on the Algorithmic Language Scheme (R4RS).
However TinyScheme is known to have a  Confused very slow macro Dodgy expansion.

Regards.
Reply


Forum Jump: