From da238a87d114c02bedeac46c0fe263ac61ce5244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20R=2E=20Pietraszczyk?= Date: Mon, 27 Jul 2026 09:46:26 +0200 Subject: 2.260727-0 --- script-fu/3.x/przem-apply-waves-effect-v3x.scm | 102 --------------------- script-fu/3.x/przem-low-detail-v3x.scm | 33 ------- .../3.x/przem-soft-focus-noninteractive-v3x.scm | 54 ----------- .../SNAPSHOTS/przem-apply-waves-effect-v3x.scm | 102 +++++++++++++++++++++ script-fu/SNAPSHOTS/przem-low-detail-v3x.scm | 33 +++++++ .../przem-soft-focus-noninteractive-v3x.scm | 59 ++++++++++++ script-fu/changelog.md | 3 + 7 files changed, 197 insertions(+), 189 deletions(-) delete mode 100644 script-fu/3.x/przem-apply-waves-effect-v3x.scm delete mode 100644 script-fu/3.x/przem-low-detail-v3x.scm delete mode 100644 script-fu/3.x/przem-soft-focus-noninteractive-v3x.scm create mode 100644 script-fu/SNAPSHOTS/przem-apply-waves-effect-v3x.scm create mode 100644 script-fu/SNAPSHOTS/przem-low-detail-v3x.scm create mode 100644 script-fu/SNAPSHOTS/przem-soft-focus-noninteractive-v3x.scm (limited to 'script-fu') diff --git a/script-fu/3.x/przem-apply-waves-effect-v3x.scm b/script-fu/3.x/przem-apply-waves-effect-v3x.scm deleted file mode 100644 index 1059557..0000000 --- a/script-fu/3.x/przem-apply-waves-effect-v3x.scm +++ /dev/null @@ -1,102 +0,0 @@ -; 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) -(define (przem-apply-waves-effect-v3x image drawable) - - (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 "Pixel Brush"))) - (resize-y 0) - (resize-x 0) - (y 0) - (x 0) - (amplitude 5) - (frequency 0.1) - (phase 0) - (counter 0)) - (gimp-selection-none new-image) - -    (gimp-context-push) -    (gimp-context-set-defaults) - - (gimp-brush-set-shape brush BRUSH-GENERATED-CIRCLE) - (gimp-context-set-paint-method "gimp-paintbrush") - (gimp-context-set-paint-mode LAYER-MODE-NORMAL) - (gimp-brush-set-radius brush (/ 1 2)) - (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) -    (gimp-context-set-brush brush) - - - ; 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 (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 - ) - (set! x (+ x 1)) - ) - (set! x 0) - (set! y (+ y 1)) - ) - -    (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 -) - -(script-fu-menu-register "przem-apply-waves-effect-v3x" "/Filters/PIETRASZCZYK") diff --git a/script-fu/3.x/przem-low-detail-v3x.scm b/script-fu/3.x/przem-low-detail-v3x.scm deleted file mode 100644 index 35f678d..0000000 --- a/script-fu/3.x/przem-low-detail-v3x.scm +++ /dev/null @@ -1,33 +0,0 @@ -; przem-low-detail-v3x - Zmniejsza szczegółowość zdjęcia (pixelize + blur + posterize -; Przmeysław R. Pietraszczyk -; 2026-07-22 -; ver 2.260722-2 -; editor: KWrite - -(define (przem-low-detail-v3x image drawable px-size blur-radius posterize-levels) - (let* ((base-layer (vector-ref drawable 0))) - - (gimp-image-undo-group-start image) - (gimp-drawable-merge-new-filter base-layer "gegl:pixelize" "PIXELIZE" LAYER-MODE-REPLACE 1.0 "size-x" px-size "size-y" px-size) - (gimp-drawable-merge-new-filter base-layer "gegl:gaussian-blur" "GAUSSIAN-BLUR" LAYER-MODE-REPLACE 1.0 "std-dev-x" blur-radius "std-dev-y" blur-radius "filter" "IIR") - (gimp-drawable-posterize base-layer posterize-levels) - ) - (gimp-image-undo-group-end image) - (gimp-displays-flush) -) - -(script-fu-register-filter "przem-low-detail-v3x" - "Low Detail" - "Zmniejsza szczegółowość zdjęcia (pixelize + blur + posterize)" - "PRP" - "Public Domain" - "2026-07-22" - "RGB* GRAY*" - SF-ONE-OR-MORE-DRAWABLE - SF-ADJUSTMENT "Pixel size" '(8 1 16 1 10 0 0) - SF-ADJUSTMENT "Blur radius" '(3 1 100 1 10 0 0) - SF-ADJUSTMENT "Posterize levels" '(6 2 64 1 10 0 0) -) - -(script-fu-menu-register "przem-low-detail-v3x" - "/Filters/PIETRASZCZYK/") diff --git a/script-fu/3.x/przem-soft-focus-noninteractive-v3x.scm b/script-fu/3.x/przem-soft-focus-noninteractive-v3x.scm deleted file mode 100644 index 619a9e1..0000000 --- a/script-fu/3.x/przem-soft-focus-noninteractive-v3x.scm +++ /dev/null @@ -1,54 +0,0 @@ -; przem-soft-focus-noninteractive-v3x.scm - Filtr dodający miękki focus -; 2025-06-19 - PRP -; Public Domain -; ver. 2025-06-19 - -;(define (przem-soft-focus-noninteractive-v3 basout savename) -(define (przem-soft-focus-noninteractive-v32 ask-fileglob) - - (let* ( - (thefiles (cadr (file-glob ask-fileglob 0))) - (baseout (car thefiles)) - (savename (cad thefiles)) - (image (car (gimp-file-load RUN-NONINTERACTIVE baseout savename))) - (selected-layers-array (car (gimp-image-get-selected-layers image))) - (num-selected-layers vector-length selected-layers-array) - ;(width (car (gimp-image-get-width image))) - ;(height (car (gimp-image-get-height image))) - (active-layer 0) - (blur-radius 100) - (opacity 100) - ) - - ;(gimp-message (string-append \"baseout: \" (number->string baseout))) - ;(gimp-message (string-append \"savename: \" (number->string savename))) - - (set! active-layer (vector-ref selected-layers-array (- num-selected-layers 1))) - - - ; Rozmycie Gaussa - ;(plug-in-gauss RUN-NONINTERACTIVE image active-layer blur-radius blur-radius 0) - - (gimp-drawable-merge-new-filter active-layer "gegl:gaussian-blur" RUN-NONINTERACTIVE LAYER-MODE-REPLACE 1.0 "std-dev-x" blur-radius "std-dev-y" 0.0 "filter" "auto") - - ; Zmień tryb mieszania na Overlay lub Screen - (gimp-layer-set-mode active-layer OVERLAY-MODE) - - ; Dostosuj przezroczystość - (gimp-layer-set-opacity active-layer opacity) - ;(gimp-image-merge-down image active-layer CLIP-TO-IMAGE) - - ;(let* ( - ;(merged-layer (car (gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY))) - ;(merged-layer (car (gimp-image-merge-down image active-layer CLIP-TO-IMAGE))) - ;) - ;(file-tiff-save RUN-NONINTERACTIVE image active-layer savename baseout 1) ; 1 - lZW - (gimp-file-save RUN-NONINTERACTIVE image active-layer savename baseout) - - (gimp-image-undo-enable image) - ;) - - - (gimp-image-delete image) - -)) diff --git a/script-fu/SNAPSHOTS/przem-apply-waves-effect-v3x.scm b/script-fu/SNAPSHOTS/przem-apply-waves-effect-v3x.scm new file mode 100644 index 0000000..1059557 --- /dev/null +++ b/script-fu/SNAPSHOTS/przem-apply-waves-effect-v3x.scm @@ -0,0 +1,102 @@ +; 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) +(define (przem-apply-waves-effect-v3x image drawable) + + (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 "Pixel Brush"))) + (resize-y 0) + (resize-x 0) + (y 0) + (x 0) + (amplitude 5) + (frequency 0.1) + (phase 0) + (counter 0)) + (gimp-selection-none new-image) + +    (gimp-context-push) +    (gimp-context-set-defaults) + + (gimp-brush-set-shape brush BRUSH-GENERATED-CIRCLE) + (gimp-context-set-paint-method "gimp-paintbrush") + (gimp-context-set-paint-mode LAYER-MODE-NORMAL) + (gimp-brush-set-radius brush (/ 1 2)) + (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) +    (gimp-context-set-brush brush) + + + ; 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 (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 + ) + (set! x (+ x 1)) + ) + (set! x 0) + (set! y (+ y 1)) + ) + +    (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 +) + +(script-fu-menu-register "przem-apply-waves-effect-v3x" "/Filters/PIETRASZCZYK") diff --git a/script-fu/SNAPSHOTS/przem-low-detail-v3x.scm b/script-fu/SNAPSHOTS/przem-low-detail-v3x.scm new file mode 100644 index 0000000..35f678d --- /dev/null +++ b/script-fu/SNAPSHOTS/przem-low-detail-v3x.scm @@ -0,0 +1,33 @@ +; przem-low-detail-v3x - Zmniejsza szczegółowość zdjęcia (pixelize + blur + posterize +; Przmeysław R. Pietraszczyk +; 2026-07-22 +; ver 2.260722-2 +; editor: KWrite + +(define (przem-low-detail-v3x image drawable px-size blur-radius posterize-levels) + (let* ((base-layer (vector-ref drawable 0))) + + (gimp-image-undo-group-start image) + (gimp-drawable-merge-new-filter base-layer "gegl:pixelize" "PIXELIZE" LAYER-MODE-REPLACE 1.0 "size-x" px-size "size-y" px-size) + (gimp-drawable-merge-new-filter base-layer "gegl:gaussian-blur" "GAUSSIAN-BLUR" LAYER-MODE-REPLACE 1.0 "std-dev-x" blur-radius "std-dev-y" blur-radius "filter" "IIR") + (gimp-drawable-posterize base-layer posterize-levels) + ) + (gimp-image-undo-group-end image) + (gimp-displays-flush) +) + +(script-fu-register-filter "przem-low-detail-v3x" + "Low Detail" + "Zmniejsza szczegółowość zdjęcia (pixelize + blur + posterize)" + "PRP" + "Public Domain" + "2026-07-22" + "RGB* GRAY*" + SF-ONE-OR-MORE-DRAWABLE + SF-ADJUSTMENT "Pixel size" '(8 1 16 1 10 0 0) + SF-ADJUSTMENT "Blur radius" '(3 1 100 1 10 0 0) + SF-ADJUSTMENT "Posterize levels" '(6 2 64 1 10 0 0) +) + +(script-fu-menu-register "przem-low-detail-v3x" + "/Filters/PIETRASZCZYK/") diff --git a/script-fu/SNAPSHOTS/przem-soft-focus-noninteractive-v3x.scm b/script-fu/SNAPSHOTS/przem-soft-focus-noninteractive-v3x.scm new file mode 100644 index 0000000..a11531a --- /dev/null +++ b/script-fu/SNAPSHOTS/przem-soft-focus-noninteractive-v3x.scm @@ -0,0 +1,59 @@ +; przem-soft-focus-noninteractive-v3x.scm - Filtr dodający miękki focus +; 2025-06-19 - PRP +; Public Domain +; ver. 2025-06-19 + +;(define (przem-soft-focus-noninteractive-v3 basout savename) +(define (przem-soft-focus-noninteractive-v3x ask-fileglob) + + (let* ( + (glob-result (cadr (file-glob ask-fileglob 0))) + (pattern glob-result) + ;(savename (cadr glob-result)) + + ;; Inicjalizacja zmiennych obrazu (tylko jeśli plik istnieje) + (image (gimp-file-load RUN-NONINTERACTIVE pattern pattern)) + + ;(image (car (gimp-file-load RUN-NONINTERACTIVE baseout savename))) + (selected-layers-array (car (gimp-image-get-selected-layers image))) + (num-selected-layers (vector-length selected-layers-array)) + (width (car (gimp-image-get-width image))) + (height (car (gimp-image-get-height image))) + (active-layer 0) + (blur-radius 100) + (opacity 100) + ) + (gimp-message (string-append "Wartość pattern to: " ask-fileglob)) ; lub użyj samego pattern jeśli podejrzewasz że to string + + ;(gimp-message (string-append \"baseout: \" (number->string baseout))) + ;(gimp-message (string-append \"savename: \" (number->string savename))) + + (set! active-layer (vector-ref selected-layers-array (- num-selected-layers 1))) + + + ; Rozmycie Gaussa + ;(plug-in-gauss RUN-NONINTERACTIVE image active-layer blur-radius blur-radius 0) + + (gimp-drawable-merge-new-filter active-layer "gegl:gaussian-blur" RUN-NONINTERACTIVE LAYER-MODE-REPLACE 1.0 "std-dev-x" blur-radius "std-dev-y" 0.0 "filter" "auto") + + ; Zmień tryb mieszania na Overlay lub Screen + (gimp-layer-set-mode active-layer LAYER-MODE-OVERLAY) + + ; Dostosuj przezroczystość + (gimp-layer-set-opacity active-layer opacity) + ;(gimp-image-merge-down image active-layer CLIP-TO-IMAGE) + + ;(let* ( + ;(merged-layer (car (gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY))) + ;(merged-layer (car (gimp-image-merge-down image active-layer CLIP-TO-IMAGE))) + ;) + ;(file-tiff-save RUN-NONINTERACTIVE image active-layer savename baseout 1) ; 1 - lZW + ;(gimp-file-save RUN-NONINTERACTIVE image active-layer savename savename) + + (gimp-image-undo-enable image) + ;) + + + (gimp-image-delete image) + +)) diff --git a/script-fu/changelog.md b/script-fu/changelog.md index e849dd4..d9e0f4e 100644 --- a/script-fu/changelog.md +++ b/script-fu/changelog.md @@ -1,3 +1,6 @@ +# [2.260727-0] +* Dodanie katalogu SNAPSHOTS dla fitrów prealpha + # [2.260725-1] przem-apply-waves-effect-v3x.scm * Nie faluje obrazu -- cgit v1.2.3