Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BIMP won't process my Script-fu script
#1
Perhaps it's a hint for me to try Python-fu. I've confirmed that the attached script works in Gimp 2.10.
The output of BIMP, though, is an unchanged image.
Am I missing something basic about BIMP?

(define (make-vignette color size opacity img)
 
  (let* ((width (car (gimp-image-width img)))
         (height (car (gimp-image-height img)))
;         (layer (car (gimp-layer-new img width height 0 "vignette" 100 NORMAL-MODE)))
         )

    (gimp-context-push)
    (gimp-image-undo-group-start img)

    (gimp-image-select-ellipse img 0 65 50 (/ width 1.3) (/ height 1.3))
    (gimp-selection-feather img size)
    (gimp-selection-invert img)
    ;(gimp-layer-set-opacity layer opacity)
    ;(gimp-layer-add-mask layer (car (gimp-layer-create-mask layer ADD-MASK-SELECTION)))
    ;(gimp-image-select-ellipse img 0 0 0 width height)
    ;(gimp-selection-clear img)
    ;(gimp-context-set-foreground '(0 255 0))
    (gimp-context-set-background color)
    ;(gimp-image-insert-layer img layer 0 -1)
    ;(gimp-drawable-edit-fill layer FILL-FOREGROUND)  
    (gimp-drawable-edit-fill img FILL-BACKGROUND)
    (gimp-selection-none img)
    (gimp-image-undo-group-end img)
    ;(gimp-displays-flush)

    (gimp-context-pop)
     
  )
)

(script-fu-register
  "make-vignette"
  "Colored Vignette"
  "Create colored vignette for the image"
  "Robert Knox"
  ""
  "April 2022"
  RGB
  SF-COLOR "Color" "#222255"
  SF-VALUE "Size" "300"
  SF-VALUE "Opacity" "100"
  SF-IMAGE "image" 0
)
(script-fu-menu-register "make-vignette" "<Image>/Filters/Light and Shadow")
Reply
#2
I've never used BIMP, but I would ask how it knows which parameter is the image id? Does it have to be named in a consistent way? or does it have to be the first parameter?
Reply
#3
(04-19-2022, 07:16 AM)Kevin Wrote: I've never used BIMP, but I would ask how it knows which parameter is the image id? Does it have to be named in a consistent way? or does it have to be the first parameter?

Not sure this is the problem, but yes, there are plenty of nice things that happen if the first parameter is an IMAGE.
Reply
#4
@robknox

You say you confirmed that script is working, however I can not get the script to produce anything. If it does not work with an open image in Gimp then definitely not going to work with BIMP.

There are other scripts that do work: This using an old python plugin https://youtu.be/foeT0c2JyN0 example. duration 2' 30"
Reply
#5
(04-19-2022, 01:02 PM)rich2005 Wrote: @robknox

You say you confirmed that script is working, however I can not get the script to produce anything. If it does not work with an open image in Gimp then definitely not going to work with BIMP.

There are other scripts that do work: This using an old python plugin https://youtu.be/foeT0c2JyN0  example. duration 2' 30"

Wow! Thank you so much for the effort and making the video, and .... you're correct.
I was about to reply with a video of my own showing "It works for me." However, the spidey sense told me to make sure that I was using the same script. I cleaned out all my backups. Apparently, my GIMP was grabbing an older version of the script.
I'm wondering if GIMP was grabbing one version and BIMP was grabbing another version.
Anyways, before I go down that road further, do you recall the location of the python-fu script that you used? Or, if not, would it be easy enough to just send the code?
Thanks again!
Rob.

(04-19-2022, 07:35 AM)Ofnuts Wrote:
(04-19-2022, 07:16 AM)Kevin Wrote: I've never used BIMP, but I would ask how it knows which parameter is the image id? Does it have to be named in a consistent way? or does it have to be the first parameter?

Not sure this is the problem, but yes, there are plenty of nice things that happen if the first parameter is an IMAGE.

First of all, "many" thanks for replying - it is greatly appreciated.
I wasn't aware that IMAGE needs to be the first parameter. From my understanding, the location of the IMAGE parameter is declared by the location of SF-IMAGE in the list. In any case, as rich2005 pointed out, the script doesn't actually work. So I need to fix that first. Then, I will try switching the order of the parameter. In fact, I've already put SF-IMAGE first, and it didn't help the script. But, it might help with the BIMP issue.
Thanks again,
Rob.

(04-19-2022, 07:16 AM)Kevin Wrote: I've never used BIMP, but I would ask how it knows which parameter is the image id? Does it have to be named in a consistent way? or does it have to be the first parameter?
Hi Kevin,
Thank you sooo much for your quick response - it is greatly appreciated. See my response to Ofnuts.
Rob.
Reply
#6
Quote:....do you recall the location of the python-fu script that you used? Or, if not, would it be easy enough to just send the code?...[

Somewhere in my plugins archive Wink Edit: There is a reference in the plugin https://declanbright.com/gimp-vignette-plugin

Zipped and attached. The usual, unzip and pop in your plugins folder
C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\plug-ins


Attached Files
.zip   vignette.zip (Size: 1.91 KB / Downloads: 102)
Reply


Forum Jump: