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

I need script help

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

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

I need script help Urke MMI 10 Dec 20:25
  I need script help Carol Spears 11 Dec 04:41
  I need script help Carol Spears 11 Dec 06:39
Urke MMI
2002-12-10 20:25:25 UTC (over 21 years ago)

I need script help

Hello,

I have GIMP 1.2.3 for Linux and need script that well automate creating of modified menu for my site. Script must to:

1) Flatten active image

2) Select rectangular from top left corner (0x0) in size of 171x111 pixel

3) Copy selection, make new image 171x111 in size, paste copied selection from previous step in new image, flatten this image (if needed) and convert to Indexed mode with 50 colors, and then save this image as top.png and then close this image

4) Make relevance selections in base image in dimensions 171x19 pixel, eight times, first selection start at 0x112 pixel left x down), and every other +19 pixel, then all other like for top.png image, but with name btn0[number_of_image].png, same png properties

5) Make one selection 171x54 from 0x264, and all other manipulation like for other images, but with bottom.png name.

6) Else I will upgrade my self

Because I'm script newbie, I need one example for this and I will enhance this basics to what I need in future.

If there is some tool to record actions in GIMP like in Adobe Photoshop, that well be pretty nice and usefull (I think :).

TIA

Carol Spears
2002-12-11 04:41:31 UTC (over 21 years ago)

I need script help

hi

On 2002-12-10 at 2025.25 +0100, Urke MMI typed this:

Hello,

I have GIMP 1.2.3 for Linux and need script that well automate creating of modified menu for my site. Script must to:

1) Flatten active image

2) Select rectangular from top left corner (0x0) in size of 171x111 pixel

3) Copy selection, make new image 171x111 in size, paste copied selection from previous step in new image, flatten this image (if needed) and convert to Indexed mode with 50 colors, and then save this image as top.png and then close this image

4) Make relevance selections in base image in dimensions 171x19 pixel, eight times, first selection start at 0x112 pixel left x down), and every other +19 pixel, then all other like for top.png image, but with name btn0[number_of_image].png, same png properties

5) Make one selection 171x54 from 0x264, and all other manipulation like for other images, but with bottom.png name.

6) Else I will upgrade my self

Because I'm script newbie, I need one example for this and I will enhance this basics to what I need in future.

If there is some tool to record actions in GIMP like in Adobe Photoshop, that well be pretty nice and usefull (I think :).

TIA

i started to put together the screenshots for a tutorial i would like to write about using the gimp pdb for script writing.

first thing you need to do is choose your flavor of scripting. the last i knew, gimp can be scripted in python, perl or a lisp thing called script fu.

they all have different strengths and draw backs.

Xtns -->Script-fu -->Console Browse ... these scripts will work with WinGIMP and The GIMP and will probably work with some rewriting on gimp-1.3.

the draw back for me was that i wasn't able find a book that to help.

however, since then i found these: http://imagic.weizmann.ac.il/~dov/gimp/scheme-tut.html http://www.linux-mag.com/2002-01/power_01.html http://www.home.unix-ag.org/simon/gimp/guadec2002/gimp-plugin/html/

example scripts can be found in your source: plug-ins/script-fu/

Xtns -->Perl there is all kinds of documentation and books. big plus. i didn't know anything about scripting and was able to find help and examples all over the place.

draw backs. so far it will only work on the linux gimp. and only on 1.2.

http://www.goof.com/pcg/marc/gimp.html http://imagic.weizmann.ac.il/~dov/gimp/perl-tut.html http://www.graphics-muse.com/gimp/articles/1999/5/199907-2.html http://www.gimp.org/~sjburges/perl_debug/intro.html

example scripts can be found in your source: plug-ins/perl/examples/

personally, i was able to write this. i have a hard time reading what i wrote even 15 minutes later ...

Xtns -->Python-Fu -->Console this works for linux gimp-1.2 and in gimp-1.3. it has good documentation. people who have been coding a lot don't mind helping with it either.

drawbacks, no WinGIMP. also, you have to download it and install it for gimp-1.2. (builds now with 1.3). good documentation, but not alot. like the nutshell book is due but not out yet. python.org is prolly all you would need for the non-gimp stuff though. i have the Python Cookbook, and it is really nice. wish i understood more of it ...

also, there are not as many script samples. but the good ones are there.

you can get it here:
http://www.daa.com.au/~james/pygimp/ documentation here:
http://www.daa.com.au/~james/pygimp/pygimp.html for the actual python in your script: http://www.python.org/doc/current/lib/lib.html http://www.python.org/doc/current/tut/tut.html http://aspn.activestate.com/ASPN/Cookbook/Python?kwd=Text

example scripts can be found in the pygimp source: pygimp-1.2/plug-ins/

i am using python lately. i don't like begging for help. you can just ask for python help (seemingly). python has handled many of my problems with regexp. the fact it works now in 1.3 is an issue for me also.

with very little experience, i was able to make the gimp work via a script without alot of help. you will have definate questions soon enough ;)

but the samples you need are in the source. better written than i can do yet ;)

carol

Carol Spears
2002-12-11 06:39:13 UTC (over 21 years ago)

I need script help

On 2002-12-10 at 2025.25 +0100, Urke MMI typed this:

Because I'm script newbie, I need one example for this and I will enhance this basics to what I need in future.

would be nice if there was an assortment of little gimp script pieces, little recipes, sorted logically.

let us see how our heros did it :)

carol