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

Script-Fu

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.

8 of 8 messages available
Toggle history

Please log in to manage your subscriptions.

Script-Fu Claus Cyrny 18 Feb 04:49
  Script-Fu David Gowers 18 Feb 05:51
  Script-Fu saulgoode@flashingtwelve.brickfilms.com 18 Feb 12:51
   Script-Fu Frantz de Germain 18 Feb 14:22
    Script-Fu saulgoode@flashingtwelve.brickfilms.com 18 Feb 18:33
     Script-Fu Claus Cyrny 18 Feb 19:20
      Script-Fu saulgoode@flashingtwelve.brickfilms.com 18 Feb 20:48
     Script-Fu Frantz de Germain 19 Feb 09:01
Claus Cyrny
2009-02-18 04:49:25 UTC (almost 16 years ago)

Script-Fu

Hi,

I'm currently trying to write a Script-Fu (actually my first one), but although I found several online tutorials on how to go about, I'm still not sure of the proper syntax for most of the steps I would like the script to perform. This is basically an advanced 'Unsharp Mask' I have been doing manually so far, but since I need it very often, would like to make a Script-Fu for this.

The steps are:

- Decompose the original RGB image to HSV - Select the V layer
- Copy the V layer into a mask
- Select merely the mask
- Perform 'Find Edges (Sobel)' (value: 2.5) on the mask - Perform 'Gaussian Blur' (value: 2) on the mask - Make a selection from the mask
- Delete the mask
- Select the V layer with the selection - Perform 'Unsharp Mask' (value depends upon the image) - Compose the image back to RGB

TIA,

Claus

David Gowers
2009-02-18 05:51:54 UTC (almost 16 years ago)

Script-Fu

Hello!

On Wed, Feb 18, 2009 at 2:19 PM, Claus Cyrny wrote:

Hi,

I'm currently trying to write a Script-Fu (actually my first one), but although I found several online tutorials on how to go about, I'm still not sure of the proper syntax for most of the steps I would like the script to perform. This is basically an advanced 'Unsharp Mask' I have been doing manually so far, but since I need it very often, would like to make a Script-Fu for this.

There are other scripting language interfaces available. Python (which I prefer myself), Perl, Ruby, and Lua scripting are all available, Python is more standardized than the others. If you have experience with one of those, I suggest to use that language instead.

Personally I think almost any language other than Script-fu is a better choice. I've got quite a wide range of experience with different programming languages myself, but when I try to work with Script-fu/Scheme/LISP, writing anything but the very simplest of procedures invokes great frustration in me.

David

saulgoode@flashingtwelve.brickfilms.com
2009-02-18 12:51:44 UTC (almost 16 years ago)

Script-Fu

Quoting Claus Cyrny :

I'm currently trying to write a Script-Fu (actually my first one), but although I found several online tutorials on how to go about, I'm still not sure of the proper syntax for most of the steps I would like the script to perform.

I've included an attachment (plain text) which contains some of code fragments which correspond with the steps you described (your steps are the lines starting with ";-" ). I left out the standard stuff such as registering your script, declaring your variables, and handling UNDO.

Frantz de Germain
2009-02-18 14:22:23 UTC (almost 16 years ago)

Script-Fu

Le Wed, 18 Feb 2009 06:51:44 -0500 saulgoode@flashingtwelve.brickfilms.com écrivait:

Quoting Claus Cyrny :

I'm currently trying to write a Script-Fu (actually my first one), but although I found several online tutorials on how to go about, I'm still not sure of the proper syntax for most of the steps I would like the script to perform.

I've included an attachment (plain text) which contains some of code fragments which correspond with the steps you described (your steps are the lines starting with ";-" ). I left out the standard stuff such as registering your script, declaring your variables, and handling UNDO.

Hello,

I'm new with scripts-fu too. I've had an eye to your script and I saw a lot of " (set! ". I thought that it doesn't work any more with TinyScheme. (cf. http://www.gimp.org/docs/script-fu-update.html)

Regards.

saulgoode@flashingtwelve.brickfilms.com
2009-02-18 18:33:36 UTC (almost 16 years ago)

Script-Fu

The code I attached to my previous post had a mistake on line #24 which should have been:
(set! layer (car (gimp-image-get-active-layer value-image)))

I also should have used 'hue-image' and 'sat-image' when I later called 'plug-in-compose' (the code I had functioned fine, it just might be a little confusing).

Quoting Frantz de Germain :

I'm new with scripts-fu too. I've had an eye to your script and I saw a lot of " (set! ".
I thought that it doesn't work any more with TinyScheme. (cf. http://www.gimp.org/docs/script-fu-update.html)

You still can (and will) use 'set!' in your scripts; but you need to create the variable first. Previously, the variable would be created automatically if it did not exist.

Claus Cyrny
2009-02-18 19:20:53 UTC (almost 16 years ago)

Script-Fu

Hi Saul,

saulgoode@flashingtwelve.brickfilms.com wrote:

The code I attached to my previous post had a mistake on line #24 which should have been:
(set! layer (car (gimp-image-get-active-layer value-image)))

I also should have used 'hue-image' and 'sat-image' when I later called 'plug-in-compose' (the code I had functioned fine, it just might be a little confusing).

thanks a lot for the code you attached, and many thanks to the others who responded!

Greetings,

Claus

saulgoode@flashingtwelve.brickfilms.com
2009-02-18 20:48:23 UTC (almost 16 years ago)

Script-Fu

I did not properly present the part about pasting the recomposed image back into the original layer. You will want to set the offsets of the pasted layer so that they match the original active layer ('drawable') and to also anchor your pasted layer. The code should be similar to the following:

(set! floating-sel (car (gimp-edit-named-paste drawable buffer-name TRUE))) (gimp-layer-set-offsets floating-sel (car (gimp-drawable-offsets drawable)) (cadr (gimp-drawable-offsets drawable))) (gimp-floating-sel-anchor floating-sel)

Frantz de Germain
2009-02-19 09:01:35 UTC (almost 16 years ago)

Script-Fu

Le Wed, 18 Feb 2009 12:33:36 -0500 saulgoode@flashingtwelve.brickfilms.com écrivait:

You still can (and will) use 'set!' in your scripts; but you need to create the variable first. Previously, the variable would be created automatically if it did not exist.

Allright, thanks for the information.