summaryrefslogtreecommitdiff
path: root/3.0/przem-traditional-photo-v3.scm
blob: ee9b72716d2e36b30721016b0bd30d84a20c55be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
; przem-traditional-photo-v3 - luźne nawiązanie do chemii tradycyjnej fototgrafii
; author: PRP
; licencja: Public Domain
; Gdańsk - 15-02-2025
; ver. 2.250217-0~beta for GIMP 3


(define (przem-traditional-photo-v3 image drawable crossing contrast-colors balance-color)
	(let (
       ;(the-image (car (gimp-image-duplicate image)) image)
       (the-layer 0)
       (image-width (car (gimp-image-get-width image)))
       (image-height (car (gimp-image-get-height image)))
       )
	(gimp-image-undo-group-start image)
	
	;(gimp-selection-all the-image)

	(set! the-layer (car (gimp-image-flatten image)))

	(if (= crossing TRUE)
		(cross image image-width image-height))
	;(if (= grain TRUE)
	;  (gimp-noise-hurl drawable 1 0.02))
	(if (= contrast-colors TRUE)
		; Zmniejsz kontrast i dodaj kolor
		(gimp-drawable-brightness-contrast the-layer -0.078125 -0.15625)
		(gimp-drawable-color-balance the-layer TRANSFER-SHADOWS TRUE balance-color 0 -30))
	
	;(gimp-selection-none the-tmage)
	
	
	(gimp-image-undo-group-end image)
	(gimp-displays-flush)
) )

(define (cross image width height)
	; crossing photo
	;(gimp-drawable-curves-spline layer1 HISTOGRAM-VALUE (spline-chrome-it))
	(let* ((layer (gimp-layer-new image "Cross" width height RGB-IMAGE 100 LAYER-MODE-NORMAL))

		(set! layer (gimp-image-merge-visible-layers image CLIP-TO-IMAGE))

		(gimp-drawable-curves-spline layer HISTOGRAM-VALUE 10 #(0 0 64 90 128 160 192 230 255 255))
		(gimp-drawable-curves-spline layer HISTOGRAM-RED 10 #(0 0 64 50 128 180 192 230 255 255))
		(gimp-drawable-curves-spline layer HISTOGRAM-GREEN 10 #(0 0 64 80 128 120 192 200 255 255))
		(gimp-drawable-curves-spline layer HISTOGRAM-BLUE 10 #(0 0 64 30 128 150 192 220 255 255))
		; lub
		;(define value #(0 0 64 90 128 160 192 230 255 255))
		;(gimp-drawable-curves-spline drawable HISTOGRAM-VALUE 10 value)
	))
)

(script-fu-register-filter "przem-traditional-photo-v3"
	_"_Convert photographs to neotraditional"
	_"Konwertuje na neotradycyjną fotografię"
	"Przemyslaw R. Pietraszczyk"
	"Public Domain"
	"2025-02-15"
	"RGB*"
	SF-ONE-OR-MORE-DRAWABLE
	SF-TOGGLE _"Crossing" FALSE
	SF-TOGGLE _"Contrast and Color corection" TRUE
	;SF-ADJUSTMENT _"Contrast" (list -0.15625 -1 1 0.00010 0.00100 0 0) ; źle działa dodanie jako parametru
	SF-ADJUSTMENT _"Balance Color" (list -30 -100 100 1 1 0 0)
) 

(script-fu-menu-register "przem-traditional-photo-v3"
                         "<Image>/Filters/PIETRASZCZYK/")