Sunday, May 23, 2010

Gimp Script-Fu Versus
Python-Fu Versus Perl-Fu

 
I have to resize several images.
I'd like to automate Gimp to do
this. My question: Which one
of Gimp's scripting capabilities
do I use?

Years ago, I used Script-Fu and
liked it. However it did require
me to learn a little bit of Scheme,
a programming language I'm unlikely
to use anywhere else.

Generally, I like to stick to a small
handful of programming languages because
it lets me leverage what I already know.
Otherwise, I'm always studying some
new programming language.

It turns out someone with more experience
with Gimp scripting than me has written
about this:

If you're going to write your first GIMP plugin...

The above article would seem to indicate
that Python-Fu is the way to go. However,
after making the following chart, I'm not
so sure:



Script-Fu, Python-Fu, and Gimp-Python Number of Web Pages Returned by Google
YearNumber of Web Pages Returned
Script-Fu
Pages
Python-Fu
Pages
Gimp-Python
Pages
200514,2001,3302,380
200627,9009,3403,190
200732,40012,9004,160
200830,3002,4404,000
200936,7002,9503,770

To make the above chart, I followed these
steps:

  1. Go to Google Home Page
  2. Search on "script-fu" 2005
  3. Search on "python-fu" 2005
  4. Search on "gimp-python" 2005
  5. Repeat above searches for each year

The chart above would seem to indicate that
Script-Fu is still more popular than Python-Fu.
I write these words on May 24, 2010.

More and more, I'm inclined to think that
learning Script-Fu is the way to go. Why?
Well, it is the older technology and so often,
the older technology is the one to learn first.

At least, I've never regretted learning the
old technology first. I learned C Language
before I learned C++. Knowing C only
made learning C++ easier.

OF course, C and C++ are not particularly
good analogs to Scheme and Python. C++
is a superset of C whereas Python basically has
nothing to do with Scheme, to the best of my
knowledge.

I don't know Python at all and my encounter with
Scheme has been brief. So, my remarks about Python
and Scheme may not be very accurate.

This article here, has shown me that I already
have a number of scheme scripts installed
under Gimp:

Gimp Scripts

Here's where the article says pre-installed Scheme
scripts are kept:

/usr/share/gimp/2.0/scripts

Here's where I put these scripts
if I wish to copy a script, modify
it, and make it my own:

~/.gimp-2.2/scripts

I see many many Scheme scripts that
I can copy and modify. Another reason
for me to use Scheme.

Here's a post by someone who describes
where Python-Fu scripts are placed and
also warns that you need to make Python
scripts executable:

What Happened to pyGIMP?

From what I see and read, it seems that
Scheme is the language that has the most
Gimp extensions.

So, I think I'll learn Script-Fu (Scheme)
first. After this, I can consider learning
Python.

Actually, it may not make that much difference.
Since I can download and modify any script I
choose from the Internet, I may not care that
much which language it is written in.

It may turn out that the language the script
is written in is not all that important.

The lesson? Do your homework first and you
will know what to do. If you don't know,
you need to do more homework.

Ed Abbott

No comments:

Post a Comment