Re: [Gimp-user] batch mode in gimp?

2013-08-03 Thread Josef Wolf
On Fr, Aug 02, 2013 at 08:18:58 +0200, Ofnuts wrote:
 On 08/02/2013 10:47 AM, Josef Wolf wrote:
 On Do, Aug 01, 2013 at 09:44:59 +0200, Ofnuts wrote:
 For such simple processing, you should consider using ImageMagick.
 Thanks for the pointer, Ofnuts!
 
 I am currently using IM. But my processing got so complicated, including
 various levels of quoting through muiltiple levels of schell scripts.
 
 I have a strong feeling that it is time for me to switch to a real, reliable
 programming language, which script-fu would be (so I hope).
 
 At the risk of raising some eyebrows, better switch to python.
 You'll find more uses for it outside of Gimp,

I know python and I know scheme (and a lot of other languages, if that
matters). Granted, I don't know the scheme dialect used by gimp.
I'd rather use any lisp dialect in favour of python. I started to learn
python, but I broke, since I just can't get used to python's lambda's. Due to
the indentation syntax, defining lambda's seems to be very ambiguous to me.

OTOH, I'd probably never need lambdas for picture manipulation 8-)

What about perl? how stable are perl's bindings to gimp?

 and inside Gimp you
 can do more things with it than with script-fu (like create your own
 dialogs...). It is also a thousand times more readable.

Ough? Isn't script-fu the _primary_ scripting language for gimp? How comes
that python, which is working on top of the primary language can be more
reliable than the primary language?

Maybe my best bet would be cl-magick? Unfortunately, all the links on
http://common-lisp.net/project/cl-magick/ seem to be dead :-(

-- 
Josef Wolf
j...@raven.inka.de
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] batch mode in gimp?

2013-08-02 Thread Josef Wolf
On Fr, Aug 02, 2013 at 03:32:55 +1200, Jehan Pagès wrote:
 You can do it this way. Tested by myself right now and working well:
 
 $ gimp-2.9 -i -d -f -s -b `cat script.scm` (simple-unsharp-mask
 \file.png\ 5.0 0.5 0) -b '(gimp-quit 0)'
 
 So basically you could have your small shell script call-gimp-function
 with the following code inside:
 
 --
 #!/bin/sh
 
 gimp-2.9 -i -d -f -s -b `cat \$1\` $2 -b '(gimp-quit 0)'
 --
 
 Then you can call it this way:
 $ ./call-gimp-function script.scm (simple-unsharp-mask \file.png\ 5.0 0.5 
 0)

Thanks for your suggestion, Jehan!

In fact, that's what I'm currently doing. But I thought there must be a better
way, since this is very prone to quoting errors. I got hidden badly when I
tried to pass a color definition as a quoted scheme list =:8O

 I think it should work well even if there are double quotes in the
 definition script because I think cat escapes them before feeding the
 contents to the main command.

I'd rather redirect stdin instead of using cat.

PS: where can I find information about how to access operating system (files,
directories, environment, etc) from script-fu? I've been searching for
TinyScheme ducumentation but could not find anyting. There seems to be
something like txn extensions and re extensions. But they don't seem to be
available from script-fu? Any hints?

-- 
Josef Wolf
j...@raven.inka.de
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] batch mode in gimp?

2013-08-02 Thread Josef Wolf
On Do, Aug 01, 2013 at 09:44:59 +0200, Ofnuts wrote:
 For such simple processing, you should consider using ImageMagick.

Thanks for the pointer, Ofnuts!

I am currently using IM. But my processing got so complicated, including
various levels of quoting through muiltiple levels of schell scripts.

I have a strong feeling that it is time for me to switch to a real, reliable
programming language, which script-fu would be (so I hope).

-- 
Josef Wolf
j...@raven.inka.de
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] batch mode in gimp?

2013-08-02 Thread Josef Wolf
On Fr, Aug 02, 2013 at 10:56:14 +0200, Maurizio Loreti wrote:
 IMHO, the best candidate for these repetitive jobs is ImageMagick - as
 suggested before by ofnuts.

I agree with this -- as long as your operations are simple.

But when your operations get more complex and involve things like like
stacking, multiple layers, etc/pp, things get very complicated because the
expressiveness and syntax/semantics are very limited by convert's very limited
command line interface.

-- 
Josef Wolf
j...@raven.inka.de
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list


[Gimp-user] batch mode in gimp?

2013-08-01 Thread Josef Wolf
Hello,

I am trying to use gimp in batch mode. Unfortunately, I can't find any
examples of how to do _real_ batch processing. All the examples on the
net show how to integrate into the gui.

I see that I can use the -b flag to invoke script-fu functions. But AFAICS,
the script with the function definitions needs to reside somewhere in
~/gimp-x.y/scripts or something.

In addition, I can't find a way to pass command line arguments to the called
functions.

Is there any way to define/execute functions? For example, I'd like to call
simple-unsharp-mask from http://www.gimp.org/tutorials/Basic_Batch/ like this:

 $ call-gimp-function script.scm simple-unsharp-mask file.png 5.0 0.5 0

Is there any way to achieve this? Any hints?

-- 
Josef Wolf
j...@raven.inka.de
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list