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

Using a filter from within 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.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

Using a filter from within script-fu Rune K. Svendsen 22 Aug 03:25
  Using a filter from within script-fu Rob Antonishen 22 Aug 11:17
Using a filter from within script-fu Rune K. Svendsen 22 Aug 03:27
Using a filter from within script-fu Kevin Brubeck Unhammer 22 Aug 06:29
  Using a filter from within script-fu Rune K. Svendsen 23 Aug 14:33
   Using a filter from within script-fu Rob Antonishen 23 Aug 15:18
Rune K. Svendsen
2012-08-22 03:25:47 UTC (over 12 years ago)

Using a filter from within script-fu

Hi list

I'm learning how to write script-fu scripts. I've managed to resize an image, but I would like to use a filter from within the script-fu script, applying it to the image after it's been resized. More specifically, I'd like to run the Filters->Generic->Dilate filter on the image, before saving it. I've searched on Google for how to do this, but I can't find any references to using filters from within a script. Can anyone help me on this?

Thanks!

/Rune

Rune K. Svendsen
2012-08-22 03:27:28 UTC (over 12 years ago)

Using a filter from within script-fu

Hi list

I'm learning how to write script-fu scripts. I've managed to resize an image, but I would like to use a filter from within the script-fu script, applying it to the image after it's been resized. More specifically, I'd like to run the Filters->Generic->Dilate filter on the image, before saving it. I've searched on Google for how to do this, but I can't find any references to using filters from within a script. Can anyone help me on this?

Thanks!

/Rune

Kevin Brubeck Unhammer
2012-08-22 06:29:49 UTC (over 12 years ago)

Using a filter from within script-fu

"Rune K. Svendsen" writes:

Hi list

I'm learning how to write script-fu scripts. I've managed to resize an image, but I would like to use a filter from within the script-fu script, applying it to the image after it's been resized. More specifically, I'd like to run the Filters->Generic->Dilate filter on the image, before saving it. I've searched on Google for how to do this, but I can't find any references to using filters from within a script. Can anyone help me on this?

Click Help, then either Plug-in browser or Procedure browser (not sure why there are two), type "dilate". You'll see the name of the main entry function, "plug-in-dilate", in bold, followed by the help string, list of parameters it takes, their types and possible values.

Often it's helpful to look at the source of that function, in case you only want do part of what it does. Unfortunately, there doesn't seem to be a one-click method to go straight to the source of non-compiled functions (hint hint, developers). Typing "locate dilate|grep -v '/help/'"
into my command line gave me nothing, so perhaps it's written in C or something.

Rob Antonishen
2012-08-22 11:17:27 UTC (over 12 years ago)

Using a filter from within script-fu

I use it in
http://ffaat.pointclark.net/incoming/scripts/FlattingTools_24.scm

There I call it like: (plug-in-dilate RUN-NONINTERACTIVE img inLayer 1 HISTOGRAM-VALUE 1.0 7 0 255)

Check out the PDB to determine the parameters.

-Rob A> ------------------------------
*From:* "Rune K. Svendsen"
*To:* "gimp-user-list@gnome.org"
*Sent:* August 22, 2012 2:59 AM
*Subject:* [Gimp-user] Using a filter from within script-fu

Hi list

I'm learning how to write script-fu scripts. I've managed to resize an image, but I would like to use a filter from within the script-fu script, applying it to the image after it's been resized. More specifically, I'd like to run the Filters->Generic->Dilate filter on the image, before saving it. I've searched on Google for how to do this, but I can't find any references to using filters from within a script. Can anyone help me on this?

Thanks!

/Rune

Rune K. Svendsen
2012-08-23 14:33:17 UTC (over 12 years ago)

Using a filter from within script-fu

Thanks, both Rob and Kevin! Exactly what I was looking for. I was wondering where the documentation for all the functions were. Looks like Help->Plug-in browser was what I was looking for.

In GIMP, when I click Filters->Generic->Dilate, the function is just performed without it asking for any parameters. How do I find out what the values are of the parameters, when using this filter from GIMP?

/Rune

On 08/22/2012 08:29 AM, Kevin Brubeck Unhammer wrote:

"Rune K. Svendsen" writes:

Hi list

I'm learning how to write script-fu scripts. I've managed to resize an image, but I would like to use a filter from within the script-fu script, applying it to the image after it's been resized. More specifically, I'd like to run the Filters->Generic->Dilate filter on the image, before saving it. I've searched on Google for how to do this, but I can't find any references to using filters from within a script. Can anyone help me on this?

Click Help, then either Plug-in browser or Procedure browser (not sure why there are two), type "dilate". You'll see the name of the main entry function, "plug-in-dilate", in bold, followed by the help string, list of parameters it takes, their types and possible values.

Often it's helpful to look at the source of that function, in case you only want do part of what it does. Unfortunately, there doesn't seem to be a one-click method to go straight to the source of non-compiled functions (hint hint, developers). Typing "locate dilate|grep -v '/help/'"
into my command line gave me nothing, so perhaps it's written in C or something.

Rob Antonishen
2012-08-23 15:18:55 UTC (over 12 years ago)

Using a filter from within script-fu

In the procedure browser (not the plugin browser) You can see the parameters:

run-mode image
drawable
propagate mode - 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent propagating-channel - HISTOGRAM-VALUE uses the value, you can also use HISTOGRAM-RED HISTOGRAM-BLUE, HISTOGRAM-GREEN or (I think) HISTOGRAM-ALPHA
propagating-rate - 0-1 (float)
direction-mask - 0-15 (int) - bit mask 0b0000 each bit is a direction. lower-limit - 0-255
upper-limit - 0-255

(plug-in-dilate RUN-NONINTERACTIVE img inLayer 1 HISTOGRAM-VALUE 1.0 15 0 255) is equivalent to calling dilate from the filter->Generic menu. (I think).

source code: http://git.gnome.org/browse/gimp/tree/plug-ins/common/value-propagate.c

-Rob A>

On Thu, Aug 23, 2012 at 10:33 AM, Rune K. Svendsen wrote:

Thanks, both Rob and Kevin! Exactly what I was looking for. I was wondering where the documentation for all the functions were. Looks like Help->Plug-in browser was what I was looking for.

In GIMP, when I click Filters->Generic->Dilate, the function is just performed without it asking for any parameters. How do I find out what the values are of the parameters, when using this filter from GIMP?

/Rune

On 08/22/2012 08:29 AM, Kevin Brubeck Unhammer wrote:

"Rune K. Svendsen" writes:

Hi list

I'm learning how to write script-fu scripts. I've managed to resize an image, but I would like to use a filter from within the script-fu script, applying it to the image after it's been resized. More specifically, I'd like to run the Filters->Generic->Dilate filter on the image, before saving it. I've searched on Google for how to do this, but I can't find any references to using filters from within a script. Can anyone help me on this?

Click Help, then either Plug-in browser or Procedure browser (not sure why there are two), type "dilate". You'll see the name of the main entry function, "plug-in-dilate", in bold, followed by the help string, list of parameters it takes, their types and possible values.

Often it's helpful to look at the source of that function, in case you only want do part of what it does. Unfortunately, there doesn't seem to be a one-click method to go straight to the source of non-compiled functions (hint hint, developers). Typing "locate dilate|grep -v '/help/'"
into my command line gave me nothing, so perhaps it's written in C or something.

_______________________________________________ gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list