It is currently Thu Jul 23, 2026 8:38 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Running GIMP in CLI mode
PostPosted: Tue Jun 14, 2016 11:59 am  (#1) 
Offline
GimpChat Member

Joined: Jun 14, 2016
Posts: 5
GIMP Version: 2.8
Operating System: Windows
GIMP Experience: Basic Level



Hey,

I am running GIMP under Windows XP SP3 and experiencing some difficulties. Firstly I was getting an error while loading brushes. Well, I've deleted some of them and now GIMP seems to work pretty stable in GUI mode. The problem comes when I try to use the so called batch mode.

When I type the following:

"C:\Program Files\GIMP 2\bin\gimp-console-2.8.exe" -i -b '(simple-unsharp-mask "C:\sample.png" 5.0 0.5 0)' -b '(gimp-quit 0)'

As may be you've noticed, this piece of code is from the official website, an example script. But the interpreter is acting really strange. It just freezes without echoing success message or something and the image is not processed. Also I am unable to type anything, unless I press CTRL + C to abort the operation.

Before that I was getting error messages saying some python scripts failed. I've removed them from the scripts directory and the messages disappeared.

My plans are to use GIMP as a graphical engine on a Linux server to provide functionality for manipulating images online for certain purposes. So do you think the problem is in my OS, which is too old and the Linux version of GIMP will be much more stable? And do you have any idea how can I get the batch mode working now under Windows?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Running GIMP in CLI mode
PostPosted: Tue Jun 14, 2016 5:08 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
You can't use single quotes on the Windows command line.

Try:
"C:\Program Files\GIMP 2\bin\gimp-console-2.8.exe" -i -b "(simple-unsharp-mask \"C:\\sample.png\" 5.0 0.5 0)" -b "(gimp-quit 0)"


Kevin


Top
 Post subject: Re: Running GIMP in CLI mode
PostPosted: Wed Jun 15, 2016 2:49 am  (#3) 
Offline
GimpChat Member

Joined: Jun 14, 2016
Posts: 5
Thanks for the answer. Actually that works, the effect is applied to the image and a success message is outputted. Several times I had the same result, but the real problem is that it takes a big while for the interpreter to start. Even when I run GIMP in GUI mode and choose Filters > Script-Fu > Console from the menu, nothing happens in about 1 minute and then the Script-Fu console appears. Doesn't seem normal and it makes me wonder if my OS is not compatible enough with the latest versions of GIMP. I guess they are made for Windows 7 and higher.


Top
 Post subject: Re: Running GIMP in CLI mode
PostPosted: Wed Jun 15, 2016 4:30 am  (#4) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2610
It used to be that for a 32 bit Windows (ie XP) Gimp started slowly in certain versions. After Gimp 2.8.4 up to (I think) 2.8.12 there was a lot of loading/initializing at each start-up.

I have a WinXPsp3 Virtual Machine, never updated after 2.8.4 for that reason.

Running that command takes 12 seconds, but updated to the latest Gimp 2.8.16 takes 14 seconds and that could be me + stopwatch + error.

So, not much in it.

Going to linux, speed is a bit different, using my regular PClinuxOS 32 bit, in a terminal, the command takes about 3 seconds (including lots of warnings from other dubious plugins I have installed)

So, you might be OK in a linux server.

However, depending what you want to do, ImageMagick might be a better bet for a server.

A little better measuring ;)

WinXP about 12 seconds

Attachment:
cli.jpg
cli.jpg [ 43.44 KiB | Viewed 3364 times ]


and in linux, probably a second or two if I ever get round to cleaning up my Gimp profile.
[rich@localhost ~]$ cd temp
[rich@localhost temp]$ sh cli.sh
user    0m0.00s
sys     0m0.00s

(gimp-console-2.8:19713): GLib-GObject-WARNING **: g_object_set_valist: object class 'GeglConfig' has no property named 'cache-size'
***lots and lots of warnings deleted****
(gimp-console-2.8:19713): LibGimpBase-WARNING **: gimp-console-2.8: gimp_wire_read(): error
batch command executed successfully
user    0m4.99s
sys     0m1.03s
[rich@localhost temp]$   


Top
 Post subject: Re: Running GIMP in CLI mode
PostPosted: Wed Jun 15, 2016 5:46 am  (#5) 
Offline
GimpChat Member

Joined: Jun 14, 2016
Posts: 5
I don't think ImageMagick will make it. I spent a lot of time learning the syntax of ImageMagick and my conclusion is that it's not worth it at all. Most of the stuff can be done with GD, which is available by default when writing in PHP. Of course ImageMagick and GraphicsMagick are much more powerful but still too primitive compared to GIMP. Scheme's syntax is thousand times easier to use, and as far as I know GIMP is the most powerful among everything that can be used for generating images on a web server.


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group