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

plug-in-sobel not consistent

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.

7 of 7 messages available
Toggle history

Please log in to manage your subscriptions.

plug-in-sobel not consistent MrShark 27 Dec 22:50
  plug-in-sobel not consistent MrShark 28 Dec 13:01
   plug-in-sobel not consistent programmer_ceds 29 Dec 16:53
    plug-in-sobel not consistent MrShark 29 Dec 17:05
     plug-in-sobel not consistent MrShark 29 Dec 17:19
      plug-in-sobel not consistent programmer_ceds 29 Dec 18:06
       plug-in-sobel not consistent MrShark 29 Dec 18:25
MrShark
2021-12-27 22:50:41 UTC (over 2 years ago)

plug-in-sobel not consistent

Hello,
I am developing my first script-fu. In my script I am using plug-in-sobel to detect edges. I was wondering about the result of the plug-in, because it differs from the result I get, when I execute the sobel-filter directly from the Filter menu (Filter > Edge detection > Sobel ...).

My script-fu-cartoon looks like (define (script-fu-cartoon
img
drawable)

; Create a new layer (define sobel-layer (car (gimp-layer-copy drawable 0))) (gimp-item-set-name sobel-layer "sobel operator") (gimp-image-insert-layer img sobel-layer 0 0)

; Execute sobel-operator (plug-in-sobel RUN-NONINTERACTIVE img sobel-layer TRUE TRUE TRUE)

(gimp-displays-flush) )
(script-fu-register "script-fu-cartoon" "/Filters/Artistic/Cartoon..."
"todo description"
"todo author"
"todo copyright"
"todo date"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Current Layer" 0
)

I am executing plug-in-sobel with the same parameters as from the GUI. But the output differs. Why is this so?

Best regards Pascal

MrShark
2021-12-28 13:01:20 UTC (over 2 years ago)

plug-in-sobel not consistent

To make my question more clear I added two images which show the different outputs. I am using the same parameters on both ways to apply the filter.

Hello,
I am developing my first script-fu. In my script I am using plug-in-sobel to detect edges. I was wondering about the result of the plug-in, because it differs from the result I get, when I execute the sobel-filter directly from the Filter menu (Filter > Edge detection > Sobel ...).

My script-fu-cartoon looks like (define (script-fu-cartoon
img
drawable)

; Create a new layer (define sobel-layer (car (gimp-layer-copy drawable 0))) (gimp-item-set-name sobel-layer "sobel operator") (gimp-image-insert-layer img sobel-layer 0 0)

; Execute sobel-operator (plug-in-sobel RUN-NONINTERACTIVE img sobel-layer TRUE TRUE TRUE)

(gimp-displays-flush) )
(script-fu-register "script-fu-cartoon" "/Filters/Artistic/Cartoon..."
"todo description"
"todo author"
"todo copyright"
"todo date"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Current Layer" 0
)

I am executing plug-in-sobel with the same parameters as from the GUI. But the output differs. Why is this so?

Best regards Pascal

2021-12-29 16:53:29 UTC (over 2 years ago)
postings
121

plug-in-sobel not consistent

To make my question more clear I added two images which show the different outputs. I am using the same parameters on both ways to apply the filter.

It looks like your script is running the built-in Sobel plug-in but when you go via "Filters/Edge Detect/Sobel..." you are getting a GEGL version that has extra parameters - for blending mode and opacity.

MrShark
2021-12-29 17:05:27 UTC (over 2 years ago)

plug-in-sobel not consistent

It looks like your script is running the built-in Sobel plug-in but when you go via "Filters/Edge Detect/Sobel..." you are getting a GEGL version that has extra parameters - for blending mode and opacity.

Is there any way to use the GEGL version in my script? I was also using the plug-in-edge with its sobel operator, but the result is also a different one: (plug-in-edge 1 img sobel-layer 1 0 0)

MrShark
2021-12-29 17:19:10 UTC (over 2 years ago)

plug-in-sobel not consistent

As discussed here http://gimpchat.com/viewtopic.php?f=9&t=18040 there is no way to call GEGL functions from script-fu. GEGL functions can only be called in python scripts.

There is an open issue for this feature: https://gitlab.gnome.org/GNOME/gimp/-/issues/1686

2021-12-29 18:06:48 UTC (over 2 years ago)
postings
121

plug-in-sobel not consistent

As discussed here http://gimpchat.com/viewtopic.php?f=9&t=18040 there is no way to call GEGL functions from script-fu. GEGL functions can only be called in python scripts.

There is an open issue for this feature: https://gitlab.gnome.org/GNOME/gimp/-/issues/1686

You could switch to using Python - much more pleasant to program in (without having to use reverse Polish notation) and more powerful.

Note, however, that GIMP Python scripting changes dramatically between GIMP V2.10 and V2.99/3 - although the core of your code would remain unchanged between the versions.

MrShark
2021-12-29 18:25:28 UTC (over 2 years ago)

plug-in-sobel not consistent

You could switch to using Python - much more pleasant to program in (without having to use reverse Polish notation) and more powerful.

Note, however, that GIMP Python scripting changes dramatically between GIMP V2.10 and V2.99/3 - although the core of your code would remain unchanged between the versions.

Thanks for your update. I'll give it a try and write my script with python.