Script-fu bucket fill tool uses Paintbrush tool opacity
GIMP version: 2.10.12
Operating System:
- Windows 10 64 bits
- Linux (Solus)
Package: -
- setup.exe (Windows)
- eopkg package (Solus)
Description of the bug
Hi everyone. I made a simple script-fu, to do funny things with comics. It helps clean the "speech balloons"
I can "fuzzy select" the speech ballons, and lauch the script, to remove the text.
What it does is :
- remove holes from selection
- bucket fill the new selection with background color
However, if my previous tool is the Paintbrush, the script use the opacity setting from the Paintbrush, and not from Bucket fill tool. So that is the bug.
(I know I could just add two lines :
(gimp-context-set-paint-mode LAYER-MODE-NORMAL)
(gimp-context-set-opacity 100)
and, actually, I did !
But I wanted to report this, anyway, cause I'm not sure this behaviour is normal. It's like the opacity setting being used is the last seen in the GUI Editor, even if it's completely unrelated with "fill selection" function. I'm not sure. Maybe it's the expected behavior ?
Reproduction
Is the bug reproducible? [Always]
Reproduction steps:
- Place the script file in your script folder
- Open the test file
- Set background color to white
- Set your bucket fill tool opacity to 100
- Set your Paintbrush tool opacity to 50
- Fuzzy select in the speech balloon (threshold = 15)
- Launch the script (in Test-script-fu) menu …
Expected result: Speech balloon clean, no more text, all is white
Actual result: Text is still here, with 50% opacity
Additional information
If the tool used just before the fuzzy select is the Bucket Fill (with opacity 100), the script behaves as expected.
(define (script-fu-clean image drawable)
;variable
(let* (
(drawable (car (gimp-image-active-drawable image)))
)
;Prep
(gimp-context-push)
(gimp-image-undo-group-start image)
; Remove holes and fill whole selection
(gimp-selection-flood image)
(gimp-drawable-edit-fill drawable FILL-BACKGROUND)
(gimp-selection-none image)
;Finish
(gimp-displays-flush)
(gimp-image-undo-group-end image)
(gimp-context-pop)
);end let
)
(script-fu-register "script-fu-clean"
"Clean"
"Clean"
"Sergeileduc"
"Sergeileduc"
"2019-07"
"RGB*"
SF-IMAGE "Input Image" 0
SF-DRAWABLE "Current Layer" 0
)
( script-fu-menu-register
"script-fu-clean" "<Image>/Test-script-fu/")