summaryrefslogtreecommitdiff
path: root/3.0/przem-apply-sepia-v3.scm
diff options
context:
space:
mode:
authorPrzemysław <przem@prymula.ct8.pl>2025-02-15 17:17:28 +0100
committerPrzemysław <przem@prymula.ct8.pl>2025-02-15 17:17:28 +0100
commit5d006fd5f62fb2b1eaa01969e746c98570b3402f (patch)
tree2551c9da63be4b871386361d279cede63e7add81 /3.0/przem-apply-sepia-v3.scm
parentd98edec1bbc19469a9e602a4576d9dfe58b8815d (diff)
przem-apply-sepia-v3.scm-2.250215-0
Diffstat (limited to '3.0/przem-apply-sepia-v3.scm')
-rw-r--r--3.0/przem-apply-sepia-v3.scm40
1 files changed, 20 insertions, 20 deletions
diff --git a/3.0/przem-apply-sepia-v3.scm b/3.0/przem-apply-sepia-v3.scm
index c7faea3..91896be 100644
--- a/3.0/przem-apply-sepia-v3.scm
+++ b/3.0/przem-apply-sepia-v3.scm
@@ -2,7 +2,10 @@
; author: PRP
; licencja: Public Domain
; Gdańsk - 07-02-2025
-; ver. 1.2502014-0 for GIMP 3
+; ver. 2.2502015-0 for GIMP 3
+;
+; BUG ? Niepotrafi przekonwertować szarego obrazka na rgb
+; * Póki co w przypadku mochromatycznego zdjęcia, nakłada jedynie gradient, bez sepii
(define (przem-apply-sepia-v3 image drawable value-slider-sepia gradient-reverse gradient-shape)
(let* (
@@ -11,45 +14,42 @@
(layer (vector-ref drawable 0))
(type (car (gimp-drawable-type-with-alpha layer)))
(center-x (/ image-width 2))
- (center-y (/ image-height 2)) ; either is OK
- ;(sepia-layer (car (gimp-layer-new image image-width image-height RGBA-IMAGE "Sepia Layer" 100 LAYER-MODE-NORMAL)))
+ (center-y (/ image-height 2))
(sepia-layer (car (gimp-layer-new image "Sepia" image-width image-height RGB-IMAGE 100 LAYER-MODE-NORMAL)))
- ;(is-nocolorful (car (gimp-drawable-is-gray 1 drawable))) ; czy obraz jest w odcieniach szarości
(radius (sqrt (+ (* center-x center-x) (* center-y center-y))))
)
(gimp-image-undo-group-start image)
;(gimp-image-undo-disable image)
+ ; TODO
+ ; jeśli obraz jest szary to konwertuje go na RGB - w RC2 ten numer nie przedzie
+ ;(if (= type GRAYA-IMAGE)
+ ; (gimp-image-convert-rgb image) )
+ ; lub lepiej ...
+ ;(if (> (car (gimp-drawable-type (vector-ref drawable 0))) 1 )
+ ; (gimp-image-convert-rgb image))
-
- ; jeśli obraz jest szary to konwertuje go na RGB - tak na sztukę
- ;(if (= is-nocolorful TRUE)
- ; (gimp-image-convert-rgb image)
- ;)
-
; Konwersja obrazu do skali szarości
;(gimp-desaturate drawable)
(if (= type RGBA-IMAGE)
- (gimp-drawable-desaturate layer DESATURATE-LIGHTNESS))
-
- ; Dodanie koloru sepii
-
- (gimp-image-insert-layer image sepia-layer 0 -1)
+ (gimp-drawable-desaturate layer DESATURATE-LIGHTNESS))
-
- (gimp-context-push)
(gimp-context-set-foreground '(112 66 20)) ; sepia ciemniejszy
(gimp-context-set-background '(233 213 186)) ; sepia jasniejszy
+ ;(gimp-context-set-background '(210 180 140)) ; sepia jasniejsza
- ;(gimp-context-set-foreground '(112 66 20)) ; ciemniejsza
- ;(gimp-context-set-background '(210 180 140)) ; jasniejsza
+ ; Dodanie koloru sepii
+ (gimp-image-insert-layer image sepia-layer 0 -1)
+
+ (gimp-context-push)
+
;(plug-in-checkerboard #:run-mode RUN-NONINTERACTIVE
; #:image image
; #:drawables (vector drawable)
; #:psychobilly 0
; #:check-size 8)
- (plug-in-checkerboard RUN-NONINTERACTIVE image (vector sepia-layer) 0 8)
+ (plug-in-checkerboard RUN-NONINTERACTIVE image (vector sepia-layer) 0 2)
(gimp-context-pop)