summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemysław R. Pietraszczyk <przem@prymula.ct8.pl>2026-07-25 17:03:01 +0200
committerPrzemysław R. Pietraszczyk <przem@prymula.ct8.pl>2026-07-25 17:03:01 +0200
commitb98ad8ec6096e90489a9c91b0d37775d0afd0688 (patch)
tree23fec24c3d3d0c347801a0e7eaacd333908cda20
parentdb00da84c6c71301b65743eaf6d703e42aa97e25 (diff)
2.260725-0:przem-apply-waves-effect-v3x.scm
-rw-r--r--script-fu/3.x/przem-apply-waves-effect-v3x.scm103
-rw-r--r--script-fu/changelog.md8
2 files changed, 109 insertions, 2 deletions
diff --git a/script-fu/3.x/przem-apply-waves-effect-v3x.scm b/script-fu/3.x/przem-apply-waves-effect-v3x.scm
new file mode 100644
index 0000000..7ea6ead
--- /dev/null
+++ b/script-fu/3.x/przem-apply-waves-effect-v3x.scm
@@ -0,0 +1,103 @@
+; apply-waves-effect-v3x - Script-fu dodający efekt falowania
+; author: PRP
+; licencja: Public Domain
+; Gdańsk - 25-02-2025
+; ver. 1.260725-0
+
+(define (przem-apply-waves-effect-v3x image drawable amplitude frequency)
+
+ (let* (
+         (width (car (gimp-image-get-width image)))
+         (height (car (gimp-image-get-height image)))
+         (new-image (car (gimp-image-duplicate image)))
+ (new-drawable 0)
+ ;(brush (car (gimp-brush-new "TQ84 Brush")))
+ (brush (car (gimp-brush-new "Pixel Brush")))
+ (resize-y 0)
+ (resize-x 0)
+ (y 0)
+ (x 0)
+ (phase 0)
+ (counter 0))
+ (gimp-selection-none new-image)
+
+    (gimp-context-push)
+    (gimp-context-set-defaults)
+
+    (gimp-context-set-brush brush)
+ (gimp-context-set-brush-size 1)
+ (gimp-context-set-brush-angle 0.0)
+ (gimp-context-set-brush-hardness 1.0)
+ (gimp-context-set-opacity 100.0)
+
+ ; symulacja
+ (while (< y height)
+      (while (< x width)
+ (set! resize-x (+ x (* amplitude (sin (+ (* frequency x) phase)))))
+          (set! resize-y (+ y (* amplitude (cos (+ (* frequency y) phase)))))
+ (set! x (+ x 1))
+ (set! counter (+ counter 1))
+ )
+ (set! x 0)
+ (set! y (+ y 1))
+ )
+
+
+ (gimp-image-scale new-image resize-x resize-y)
+    ;(set! new-drawable (car (gimp-drawable-get-visible new-image)))
+ (set! new-drawable (vector-ref (car (gimp-image-get-selected-layers new-image)) 0))
+
+ (set! x 0)
+ (set! y 0)
+
+    ; Przejdź przez każdy piksel obrazu
+    (while (< y height)
+      (while (< x width)
+        (let* (
+          (new-x (+ x (* amplitude (sin (+ (* frequency x) phase)))))
+          (new-y (+ y (* amplitude (cos (+ (* frequency y) phase)))))
+          (color (car (gimp-image-pick-color image drawable x y FALSE FALSE 1)))
+ (how-many-points 1)
+ (point (vector new-x new-y))
+ )
+ (gimp-context-set-foreground color)
+ ;(gimp-brushes-refresh)
+
+    (gimp-pencil new-drawable point how-many-points) ; Narysuj punkt
+
+ (gimp-message "Wait...")
+ ;(display "pixel: ") (displayln pixel)
+ )
+ (set! x (+ x 1))
+ )
+ (set! x 0)
+ (set! y (+ y 1))
+ )
+ ;(gimp-image-set-resolution image newdpi newdpi)
+
+
+    (gimp-context-pop)
+    (gimp-display-new new-image)
+
+ (gimp-selection-none new-image)
+
+ (gimp-displays-flush)
+
+) )
+
+(define displayln (lambda (obj) (display obj) (display "\n")))
+
+
+( script-fu-register-filter "przem-apply-waves-effect-v3x"
+ "Apply a waves effect to the image."
+ "Dodaje efekt fali do zdjęcia"
+ "Przenmysław R. Pietraszczyk"
+ "Public Domain"
+ "2025-02-25"
+ "RGB*, GRAY*"
+ SF-ONE-OR-MORE-DRAWABLE
+ SF-ADJUSTMENT "Amplitude" '(10 1 100 1 10 0 0)
+ SF-ADJUSTMENT "Frequency" '(0.1 0.0 1.0 0.1 0.1 1 0)
+)
+
+(script-fu-menu-register "przem-apply-waves-effect-v3x" "<Image>/Filters/PIETRASZCZYK")
diff --git a/script-fu/changelog.md b/script-fu/changelog.md
index 7579525..2273453 100644
--- a/script-fu/changelog.md
+++ b/script-fu/changelog.md
@@ -1,5 +1,9 @@
-# [2.260724-0] przem-hitchcock-d400-film-effect-v32.scm
-* Implementacja ilości czerni i kontrasyu w SF-OPTION
+# [2.260725-0] przem-apply-waves-effect-v3x.scm
+* Próba portu filtra dla Gimpa 3.
+* Nie widzi argumentow
+
+# [2.260724-1] przem-hitchcock-d400-film-effect-v32.scm
+* Implementacja ilości czerni i kontrastu w SF-OPTION
# [2.260722-3] przem-dramatic-light-3x.scm
* Prawdziwe dramatyczne światła i mroczny kontrast, działa ze zdjeciami kolorowymi