From b975e7bc6d737c3eeb51f66579deecc66c3b9965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw?= Date: Sat, 15 Feb 2025 21:52:57 +0100 Subject: 2.250215-1 --- 3.0/przem-add-background-under-text-v3.scm | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to '3.0/przem-add-background-under-text-v3.scm') diff --git a/3.0/przem-add-background-under-text-v3.scm b/3.0/przem-add-background-under-text-v3.scm index 0b201d3..943e00c 100644 --- a/3.0/przem-add-background-under-text-v3.scm +++ b/3.0/przem-add-background-under-text-v3.scm @@ -2,7 +2,7 @@ ; author: PRP ; licencja: Public Domain ; Gdańsk - 06-02-2025 -; ver. 1.250210-0~alpha for Gimp 3.0 +; ver. 2.250215-1~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) @@ -21,8 +21,8 @@ (bg-x-right (+ text-width 10)) ;(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 bg-x-right text-height RGBA-IMAGE "Background" 100 LAYER-MODE-NORMAL))) - (is-nocolorful (car (gimp-drawable-is-gray drawable))) ; czy obraz jest w odcieniach szarości + (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 ) ; Ustawienie koloru tła @@ -33,16 +33,23 @@ (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) - ) - + ;(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) ;(gimp-layer-translate bg-layer bg-x-left pos-y) ;(gimp-selection-translate image bg-layer bg-x-left pos-y) - (gimp-layer-set-offsets bg-layer bg-x-left pos-y) + (gimp-layer-set-offsets bg-layer bg-x-left pos-y) (if (= background-transparency TRUE) (begin (gimp-drawable-fill bg-layer FILL-TRANSPARENT) -- cgit v1.2.3