diff options
| author | Przemysław <przem@prymula.ct8.pl> | 2026-01-16 18:01:17 +0100 |
|---|---|---|
| committer | Przemysław <przem@prymula.ct8.pl> | 2026-01-16 18:01:17 +0100 |
| commit | 8a8eac8f5ae9ebb4f5ac9f85e408a986436ccbef (patch) | |
| tree | e1f61afefb95235aef8cee2691dd2bf58d4a3193 | |
| parent | 3aab6350f519a7077af8c1ffa8092c1a5c4070bc (diff) | |
2.260116-0:/przem-add-background-under-text-v3.scm
| -rw-r--r-- | script-fu/3.0/przem-add-background-under-text-v3.scm | 29 | ||||
| -rw-r--r-- | script-fu/changelog.md | 3 |
2 files changed, 13 insertions, 19 deletions
diff --git a/script-fu/3.0/przem-add-background-under-text-v3.scm b/script-fu/3.0/przem-add-background-under-text-v3.scm index 943e00c..a6fffdf 100644 --- a/script-fu/3.0/przem-add-background-under-text-v3.scm +++ b/script-fu/3.0/przem-add-background-under-text-v3.scm @@ -2,13 +2,12 @@ ; author: PRP
; licencja: Public Domain
; Gdańsk - 06-02-2025
-; ver. 2.250215-1~alpha for Gimp 3.0
+; ver. 2.260116-0~alpha for Gimp 3.0
(define (przem-add-background-under-text-v3 image drawable text font font-size fg-color bg-color background-transparency opacity)
- (gimp-image-undo-group-start image)
-
(let* (
+ (type-layer (vector-ref drawable 0))
(image-width (car (gimp-image-get-width image)))
(image-height (car (gimp-image-get-height image)))
;(text-extents (gimp-text-get-extents-fontname text font-size 0 font))
@@ -22,27 +21,20 @@ ;(text-layer (car (gimp-text-fontname image -1 0 0 text 0 TRUE font-size 0 font)))
(text-layer (car(gimp-text-font image -1 0 0 text 0 TRUE font-size font)))
(bg-layer (car (gimp-layer-new image "Background" bg-x-right text-height RGB-IMAGE 100 LAYER-MODE-NORMAL)))
- ;(is-nocolorful (car (gimp-drawable-is-gray drawable))) ; czy obraz jest w odcieniach szarości
+ (is-nocolorful (car (gimp-drawable-is-gray type-layer))) ; czy obraz jest w odcieniach szarości
)
+ (gimp-image-undo-group-start image)
+
+ ;(if (= is-nocolorful TRUE)
+ ; (gimp-image-convert-rgb image)
+ ;)
; Ustawienie koloru tła
(gimp-context-set-background bg-color)
(gimp-context-set-foreground fg-color)
(gimp-drawable-fill bg-layer FILL-BACKGROUND)
(gimp-layer-set-opacity bg-layer opacity)
-
- ; jeśli obraz jest szary to konwertuje go na RGB - tak na sztukę
- ;(if (= is-nocolorful TRUE)
- ; (gimp-image-convert-rgb image)
- ;)
- ; TODO
- ; jeśli obraz jest szary to konwertuje go na RGB - w RC2 ten numer nie przedzie
- ;(if (= type GRAY-IMAGE)
- ; (gimp-image-convert-rgb image) )
- ; lub lepiej ...
- ;(if (> (car (gimp-drawable-type (vector-ref drawable 0))) 1 )
- ; (gimp-image-convert-rgb image))
; Dodanie warstwy tła pod tekstem
(gimp-image-insert-layer image bg-layer 0 -1)
@@ -74,15 +66,14 @@ )
)
-(script-fu-register "przem-add-background-under-text-v3"
+(script-fu-register-filter "przem-add-background-under-text-v3"
_"Add Background Under Text"
_"Dodaje kolorowe tło pod tekstem z możliwością wyboru czcionki i rozmiaru."
"Przemysław R. Pietraszczyk"
"Public Domain"
"2025-02-06"
"RGB* GRAY*"
- SF-IMAGE "Image" 0
- SF-DRAWABLE "Drawable" 0
+ SF-ONE-OR-MORE-DRAWABLE
SF-STRING "Text" "Doda Elektroda"
SF-FONT "Font" "Monospace"
SF-ADJUSTMENT "Font Size" (list 50 1 1000 1 10 0 1)
diff --git a/script-fu/changelog.md b/script-fu/changelog.md index eca13ab..5604484 100644 --- a/script-fu/changelog.md +++ b/script-fu/changelog.md @@ -1,3 +1,6 @@ +# [2.260116-0] przem-add-background-under-text-v3.scm +* Porządki, jednak filtr dalej nie dodaje kolorwego napisu do obrazów czarno-bialych + # [2.260109-0] przem-lith-effect-v3.scm, przem-surreal-v3.scm * Dodanie checkboxa z wyborem odcienia dla Obróbki Litowej * gegl:color dla surreal |
