diff options
author | Przemysław R. Pietraszczyk <przem@prymula.ct8.pl> | 2025-06-29 20:54:25 +0200 |
---|---|---|
committer | Przemysław R. Pietraszczyk <przem@prymula.ct8.pl> | 2025-06-29 20:54:25 +0200 |
commit | e8d42b19bc5892de59924d108687bb09069a251a (patch) | |
tree | f2155bf96f91ad530e1d73003562fe52714a9db6 |
Init
26 files changed, 2059 insertions, 0 deletions
diff --git a/bash/2.10/przem-soft-focus-noninteractive-TIFF.sh b/bash/2.10/przem-soft-focus-noninteractive-TIFF.sh new file mode 100755 index 0000000..b00821f --- /dev/null +++ b/bash/2.10/przem-soft-focus-noninteractive-TIFF.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# przem-soft-focus-noninteractive-TIFF.sh - Filtr dodający miękki focus +# 2025-06-16 - PRP +# Public Domain + +files=$(ls *.ARW) + +for file in $files; do + if [ $file = "DSC09234.ARW" ]; then + base_name=${file%.ARW} # wycina rozszerzenie + loadtiff=$base_name.tiff + baseout=$base_name.pejzaz.tiff + savename=PEJZAZ/$baseout + dcraw -v -r 2.726191 1.000000 1.479328 1.064126 -H 0 -b 1.0 -o 1 -q 3 -6 -T $file + while [ ! -e $base_name.tiff ]; do + echo "czekam" + done + convert $loadtiff -bordercolor white -border 30 -compress lzw $baseout + +flatpak run org.gimp.GIMP -i -f -b " + + (let* ( + (img (car (gimp-file-load RUN-NONINTERACTIVE \"$baseout\" \"$savename\"))) + (drawable (car (gimp-image-get-active-layer img))) + (soft-layer (car (gimp-layer-copy drawable FALSE))) + (blur-radius 100) + (opacity 100) + ) + + (gimp-image-insert-layer img soft-layer 0 -1) + (gimp-item-set-name soft-layer \"soft\") + (gimp-image-set-active-layer img soft-layer) + (gimp-image-remove-layer img drawable) + + ; Rozmycie Gaussa + (plug-in-gauss RUN-NONINTERACTIVE img soft-layer blur-radius blur-radius 0) + + ; Zmień tryb mieszania na Overlay lub Screen + (gimp-layer-set-mode soft-layer OVERLAY-MODE) + + ; Dostosuj przezroczystość + (gimp-layer-set-opacity soft-layer opacity) + ;(gimp-image-merge-down img soft-layer CLIP-TO-IMAGE) + + ;(let* ( + ;(merged-layer (car (gimp-image-merge-visible-layers img EXPAND-AS-NECESSARY))) + ;(merged-layer (car (gimp-image-merge-down img soft-layer CLIP-TO-IMAGE))) + ;) + (file-tiff-save RUN-NONINTERACTIVE img soft-layer \"$savename\" \"$baseout\" 1) ; 1 - lZW + (gimp-image-undo-enable img) + ;) + + ;(gimp-file-save RUN-NONINTERACTIVE img soft-layer \"$savename\" \"$loadtiff\") + + (gimp-image-delete img) + +)) + +" -b "(gimp-quit 0)" + rm $base_name.pejzaz.tiff + rm $base_name.tiff + fi +done diff --git a/bash/2.10/przem-soft-focus-noninteractive.sh b/bash/2.10/przem-soft-focus-noninteractive.sh new file mode 100644 index 0000000..f425034 --- /dev/null +++ b/bash/2.10/przem-soft-focus-noninteractive.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# przem-soft-focus-noninteractive.sh - Filtr dodający miękki focus +# 2025-06-16 - PRP +# Public Domain + +files=$(ls *.jpg) + +for file in $files; do + #if [ $file = "DSC09223.jpg" ]; then + base_name=${file%.jpg} # wycina rozszerzenie + savename=FOCUS/$base_name.jpg + +flatpak run org.gimp.GIMP -i -f -b " + + (let* ( + (img (car (gimp-file-load RUN-NONINTERACTIVE \"$file\" \"$savename\"))) + (drawable (car (gimp-image-get-active-layer img))) + (soft-layer (car (gimp-layer-copy drawable FALSE))) + (blur-radius 30) + (opacity 100) + ) + + (gimp-image-insert-layer img soft-layer 0 -1) + (gimp-item-set-name soft-layer \"soft\") + + ; Rozmycie Gaussa + (plug-in-gauss RUN-NONINTERACTIVE img soft-layer blur-radius blur-radius 0) + + ; Zmień tryb mieszania na Overlay lub Screen + (gimp-layer-set-mode soft-layer OVERLAY-MODE) + + ; Dostosuj przezroczystość + (gimp-layer-set-opacity soft-layer opacity) + + (gimp-file-save RUN-NONINTERACTIVE img soft-layer \"$savename\" \"$file\") + + (gimp-image-delete img) + +)) + +" -b "(gimp-quit 0)" + + #fi +done diff --git a/bash/3.0/soft-focus-tiff-v3.sh b/bash/3.0/soft-focus-tiff-v3.sh new file mode 100755 index 0000000..f0f63d2 --- /dev/null +++ b/bash/3.0/soft-focus-tiff-v3.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# przem-soft-focus-noninteractive-TIFF.sh - Filtr dodający miękki focus +# 2025-06-16 - PRP +# Public Domain + +files=$(ls *.ARW) + +for file in $files; do + if [ $file = "DSC09250.ARW" ]; then + base_name=${file%.ARW} # wycina rozszerzenie + loadtiff=$base_name.tiff + baseout=$base_name.siec.tiff + savename=SIEC/$baseout + dcraw -v -r 2.726191 1.000000 1.479328 1.064126 -H 0 -b 1.0 -o 1 -q 3 -6 -T $file + while [ ! -e $base_name.tiff ]; do + echo "czekam" + done + convert $loadtiff -bordercolor white -border 30 -compress lzw $baseout + +gimp -i -f --batch-interpreter plug-in-script-fu-eval -b " + +(define (soft-focus-tiff-v3 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))) + ;(drawable (car (gimp-image-get-active-layer image))) + (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-image-undo-enable image) + ;) + + ;(gimp-file-save RUN-NONINTERACTIVE image active-layer \"$savename\" \"$loadtiff\") + + (gimp-image-delete image) + +)) +soft-focus-tiff-v3 '\"$baseout\" \"$savename\"' +" -b "(gimp-quit 0)" + rm $base_name.siec.tiff + rm $base_name.tiff + fi +done diff --git a/bash/CzytaTo.txt b/bash/CzytaTo.txt new file mode 100644 index 0000000..4fbe088 --- /dev/null +++ b/bash/CzytaTo.txt @@ -0,0 +1,4 @@ +Wystarczy uruchomić z poziomu katalogu ze zdjęciami w formacie JPG: + ./przem-soft-focus-noninteractive.sh + +Skrypt automatycznie doda efekt soft-focus do zdjęć po uprzednim utworzeniu katalogu FOCUS diff --git a/bash/all.sh b/bash/all.sh new file mode 100644 index 0000000..0aa4deb --- /dev/null +++ b/bash/all.sh @@ -0,0 +1,10 @@ +files=$(ls *.jpg) + +for file in $files; do + if [ $file = "DSC08621.jpg" ]; then + base_name=${file%.jpg} # wycina rozszerzenie + save_name=$base_name.suffix.jpg + flatpak run org.gimp.GIMP -i -b '(przem-soft-focus-noninteractive' $file $save_name ' 100 100)' -b '(gimp-quit 0)' + mv $save_name SAVE + fi +done diff --git a/bash/batch-v3-2.sh b/bash/batch-v3-2.sh new file mode 100755 index 0000000..fe13685 --- /dev/null +++ b/bash/batch-v3-2.sh @@ -0,0 +1,12 @@ +files=$(ls *.jpg) + +for file in $files; do + if [ $file = "DSC07203.jpg" ]; then + base_name=${file%.jpg} # wycina rozszerzenie + save_name=$base_name.suffix.jpg + + run="gimp -i --batch-interpreter plug-in-script-fu-eval -b '(przem-soft-focus-noninteractive-v3 "$file" "$save_name")' -b '(gimp-quit 0)'" + eval "$run" + #mv $save_name SAVE + fi +done diff --git a/bash/batch.sh b/bash/batch.sh new file mode 100644 index 0000000..34b21aa --- /dev/null +++ b/bash/batch.sh @@ -0,0 +1 @@ +flatpak run org.gimp.GIMP -i -b '(przem-soft-focus-noninteractive DSC07182.jpg DSC07182.focus.jpg 100 8)' -b '(gimp-quit 0)' diff --git a/bash/changelog.md b/bash/changelog.md new file mode 100644 index 0000000..7439886 --- /dev/null +++ b/bash/changelog.md @@ -0,0 +1,11 @@ +# [2.250619-2] przem-soft-focus-noninteractive-v3-TIFF.sh
+* Dodanie wersji filtra dla Gimpa 3.0 - uruchamia się, nie zwaraca błędu, jednak rezultatu BRAK
+
+# [2.250619-0] przem-soft-focus-noninteractive-TIFF.sh
+* Eksport do formatu TIFF z jedną warstwą
+
+# [2.250616-2] przem-soft-focus-noninteractive.sh
+* Prawdziwy soft focus
+
+# [2.250616-1] przem-soft-focus-noninteractive.sh
+* Dodanie filtra wywolywanego z linii poleceń w trybie multi plików
diff --git a/python-fu/2.10/przem-waved-cubism/przem-waved-cubism.py b/python-fu/2.10/przem-waved-cubism/przem-waved-cubism.py new file mode 100755 index 0000000..7e3a0dc --- /dev/null +++ b/python-fu/2.10/przem-waved-cubism/przem-waved-cubism.py @@ -0,0 +1,276 @@ +#!/usr/bin/env python +import sys, os, math +#gi.require_version("Gtk", "3.0") +#from gi.repository import Gtk, Gdk, GdkPixbuf +#from gi.repository.GdkPixbuf import Pixbuf +#import cairo + +from gimpfu import * + + +def get_pixel_color(layer, x, y): + + #width = layer.get_width() + #height = layer.get_height() + width, height = layer.width, layer.height + + if x > width or y > height: + return None + elif x < 0 or y < 0: + return None + + if layer.type == RGB_IMAGE: + n_channels = 3 + elif layer.type == RGBA_IMAGE: + n_channels = 4 + elif layer.type == GRAY_IMAGE: + n_channels = 1 + elif layer.type == GRAYA_IMAGE: + n_channels = 2 + else: + raise ValueError("Unsupportet channels") + + #pixels = layer.get_pixel(x, y) + #pixels = pixbuf.get_pixels() + #rowstride = pixbuf.get_rowstride() + pixel_region = layer.get_pixel_rgn(0, 0, layer.width, layer.height, False, False) + + + + + + + #pixChars=pixel_region[:,:] + #bpp=pixel_region.bpp + #return np.frombuffer(pixChars,dtype=np.uint8).reshape(1,1,bpp) + + # Get the rowstride from the pixel region + #rowstride = pixel_region.rowstride + #n_channels = pixbuf.get_n_channels() + + #offset = y * pixel_region.rowstride + x * n_channels + #pixel_data = pixel_region[offset:offset + n_channels] + + pixel_data = pixel_region[0:width, 0:height] + + width, height = layer.width, layer.height + rowstride = width * n_channels + #for y in range(height): + row_start = y * rowstride + row_end = row_start + width * n_channels + row_data = pixel_data[row_start:row_end] + #for x in range(width): + r = row_data[x * n_channels] + g = row_data[x * n_channels + 1] + b = row_data[x * n_channels + 2] + #a = row_data[x * n_channels + 3] + + #if layer.type == RGB_IMAGE or layer.type == RGBA_IMAGE: + # # Dla RGB/RGBA (R, G, B) lub (R, G, B, A) + # return tuple(byte for byte in pixel_data) + #elif layer.type == GRAY_IMAGE or layer.type == GRAYA_IMAGE: + # Dla Grayscale + # return tuple(byte for byte in pixel_data) + #else: + # raise ValueError("Unsupported type layer") + + #red = pixels[offset] + #green = pixels[offset + 1] + #blue = pixels[offset + 2] + #alpha = pixels[offset + 3] if n_channels == 4 else 255 + + #return (red, green, blue, alpha) + #return (red, green, blue) + + #if r.isdigit() and g.isdigit() and b.isdigit(): + # if r != 0 and g != 0 and b != 0: + # return (r, g, b) + #return (0, 0, 0) + + #return float(''.join(map(str, (r, g, b)))) + #if r.isdigit() and g.isdigit() and b.isdigit(): + #if r != 0 and g != 0 and b != 0: + #res="" + #for i in (r, g, b): + # res+=str(i) #str + # #return int(res) + #return res + return (r, g, b) + + +def sincos_func( data, sincos): + + h = True + angle1 = 0.1 + angle2 = 0.1 + width = len(data[0]) + height = len(data) + m = int(width / 6.666666667)+1 + print("MNOZNIK: " +str(m)) + for y in range(0, height): + + for x in range(0, width): + mod1 = x % 30 + if mod1 == 0: + angle1 *= -1 + mod2 = x % 30 + if mod2 == 0: + if h == True: + angle1 = 0.1 + h = False + else: + angle1 = -0.1 + h = True + + if h == True: + angle1 += -0.1 + else: + angle1 += 0.1 + + + + + lineX = int(10*math.sin(angle1) + x) + lineY = int(10*math.sin(angle1) + y) + #lineY = int(25*math.sin(angle1) + y*math.cos(angle1)) + #lineX = int(25*math.sin(angle1) + x*math.cos(angle1)) + #print ("lineX: " + str(lineX) + " lineY: " + str(lineY)) + if lineX >= width: + continue + if lineY >= height: + continue + if lineX < 0: + continue + if lineY < 0: + continue + + #if x >= width: + # continue + #if y >= height: + # continue + ##else: + # print ("ZA: "+ str(x) + " " + str(y)) + #sincos[lineY][lineX] = (data[y][x][0], data[y][x][1], data[y][x][2]) + sincos[y][x] = (data[lineY][lineX][0], data[lineY][lineX][1], data[lineY][lineX][2]) + +def create_pixbuf_from_rgb_tuples(drawable, colors, width, height): + + #pixels = bytearray() + x = 0 + y = 0 + pixels = bytearray() + for row in colors: + for color in row: + r, g, b = color # Rozpakuj krotke (R, G, B) + #pixels.extend([r, g, b]) + + + # Ustawienie koloru pierwszego planu (np. czerwony) + if r == u"\xef" or g == u"\xef" or b == u"\xef": + continue + pdb.gimp_context_set_foreground(float(r), float(g), float(b)) + + # Wybor pedzla (np. "Circle (11)") + pdb.gimp_context_set_brush("Circle (01)") + + # Rysowanie linii od punktu (50, 50) do punktu (450, 450) + points = [x, y, x, y] + pdb.gimp_paintbrush_default(drawable, len(points), points) + x += 1 + print("LINIA: " + str(y)) + x = 0 + y += 1 + + """ + # Pobieranie regionu do edycji + region = drawable.get_pixel_rgn(0, 0, width, height, True, True) + + for row in colors: + for color in row: + #index = y * width + x + #if index < len(color): + #r, g, b = rgb_list[index] + r, g, b = color # Rozpakuj krotke (R, G, B) + #pixels.extend([r, g, b]) + + region[x, y] = chr(r) + chr(g) + chr(b) + #else: + #region[x, y] = chr(0) + chr(0) + chr(0) + x += 1 + x = 0 + y += 1 + drawable.flush() + drawable.update(0, 0, width, height) + """ + + #return pixbuf + +def plugin_func(image, drawable, args): + + width = image.width + height = image.height + duplicate_image = pdb.gimp_image_duplicate(image) + #duplicate_drawable = pdb.gimp-image-get-active-drawable(duplicate_image) + duplicate_drawable = duplicate_image.active_layer + + # Dodaj skopiowany obraz do listy obrazow w GIMPie + #gimp.Display(duplicate_image) + #pdb.gimp-selection-none(duplicate_image) + #pdb.gimp-context-push() + #pdb.gimp-context-set-defaults() + grid = [] + for y in range (0, height): + pix_width = [] + for x in range (0, width): + pix_width.append(get_pixel_color(duplicate_drawable, x, y)) + #pix_width.append(drawable.get_pixel(x, y)) + grid.append(pix_width) + print(grid) + print("GET: " +str(y)) + + sincos = [] + for y in range (0, height): + pix_width = [] + for x in range (0, width): + pix_width.append((255, 255, 255)) + sincos.append(pix_width) + + sincos_func(grid, sincos) + + #new_image = gimp.Image(width, height, RGB) + #layer = gimp.Layer(new_image, "New Layer", width, height, RGB_IMAGE, 100, NORMAL_MODE) + #new_image.add_layer(layer, 0) + + + create_pixbuf_from_rgb_tuples(duplicate_drawable, sincos, width, height) + #pdb.gimp-context-pop() + + #pdb.gimp_displays_flush() + duplicate_drawable.flush() + duplicate_drawable.update(0, 0, width, height) + display = gimp.Display(duplicate_image) + pdb.gimp_displays_flush() + +whoiam='\n'+os.path.abspath(sys.argv[0]) + +register( + "przem-waved-cubism", + N_("Make waved cubism on image")+whoiam, + "Tworzy kubistyczne falowanie na obrazie", + "Przemyslaw R. Pietraszczyk", + "Public Domain", + "2025-03-04", + N_("Waved Cubism"), + "RGB*,GRAY*", + [ + (PF_IMAGE, "image", "Input image", None), # type, name, description, default + (PF_DRAWABLE, "drawable", "Input drawable", None), + (PF_STRING, "arg", "The argument", "default-value"), + ], + [], + plugin_func, + menu="<Image>/Filters/PIETRASZCZYK/", + #domain=("gimp30-python", gimp.locale_directory) +) + +main() diff --git a/python-fu/3.0.0RC2/przem-waved-cubism/przem-waved-cubism.py b/python-fu/3.0.0RC2/przem-waved-cubism/przem-waved-cubism.py new file mode 100755 index 0000000..4a3070f --- /dev/null +++ b/python-fu/3.0.0RC2/przem-waved-cubism/przem-waved-cubism.py @@ -0,0 +1,244 @@ +#!/usr/bin/env python3 +# przem-waved-cubism - filtr dodający efekt falowania obrazu +# 2025-03-04 © Przemysław R. Pietraszczyk +# licencja: Public Domain +# edytor: Geany +# ver. 2.250306-0~beta + +import gi +gi.require_version('Gimp', '3.0') +from gi.repository import Gimp +gi.require_version('GimpUi', '3.0') +from gi.repository import GimpUi +gi.require_version('Gegl', '0.4') +from gi.repository import Gegl +from gi.repository import GObject +from gi.repository import GLib +from gi.repository import Gio +import time +import sys +import math + +def N_(message): return message +def _(message): return GLib.dgettext(None, message) + +def sincos_func( data, sincos): + + h = True + angle1 = 0.1 + angle2 = 0.1 + width = len(data[0]) + height = len(data) + for y in range(0, height): + + for x in range(0, width): + mod1 = x % 25 + if mod1 == 0: + angle1 *= -1 + mod2 = x % 25 + if mod2 == 0: + if h == True: + angle1 = 0.1 + h = False + else: + angle1 = -0.1 + h = True + + if h == True: + angle1 += -0.1 + else: + angle1 += 0.1 + + + + + lineX = int(10*math.sin(angle1) + x) + lineY = int(10*math.sin(angle1) + y) + + print ("lineX: " + str(lineX) + " lineY: " + str(lineY)) + if lineX >= width: + continue + if lineY >= height: + continue + if lineX < 0: + continue + if lineY < 0: + continue + + #if x >= width: + # continue + #if y >= height: + # continue + ##else: + # print ("ZA: "+ str(x) + " " + str(y)) + #sincos[lineY][lineX] = (data[y][x][0], data[y][x][1], data[y][x][2]) + sincos[y][x] = (data[lineY][lineX][0], data[lineY][lineX][1], data[lineY][lineX][2]) +""" +def get_pixel_color(pixbuf, x, y): + # Pobierz szerokość i wysokość obrazu + width = pixbuf.get_width() + height = pixbuf.get_height() + + # Sprawdź, czy współrzędne są w granicach obrazu + if x < 0 or x >= width or y < 0 or y >= height: + raise ValueError("Współrzędne poza zakresem obrazu") + + # Pobierz dane pikseli + pixels = pixbuf.get_pixels() + rowstride = pixbuf.get_rowstride() + n_channels = pixbuf.get_n_channels() + + # Oblicz pozycję piksela w danych + offset = y * rowstride + x * n_channels + + + # Pobierz wartości kanałów koloru (R, G, B, A) + red = pixels[offset] + green = pixels[offset + 1] + blue = pixels[offset + 2] + alpha = pixels[offset + 3] if n_channels == 4 else 255 + + #return (red, green, blue, alpha) + return (red, green, blue) +""" + +def create_pixbuf_from_rgb_tuples(drawable, colors, width, height): + # Sprawdź, czy liczba kolorów odpowiada wymiarom obrazu + #if len(colors) != width * height: + # raise ValueError("Liczba kolorów musi być równa width * height") + + # Przekształć krotki RGB na dane pikseli + pixels = bytearray() + x = 0 + y = 0 + for row in colors: + for color in row: + r, g, b = color # Rozpakuj krotkę (R, G, B) + pixels.extend([r, g, b]) + + + # Ustawienie koloru pierwszego planu (np. czerwony) + #pdb.gimp_context_set_foreground((r, g, b)) + Gimp.context_set_foreground((r, g, b)) + + # Wybór pędzla (np. "Circle (11)") + #pdb.gimp_context_set_brush("Circle (01)") + Gimp.context_set_brush("Circle (01)") + + # Rysowanie linii od punktu (50, 50) do punktu (450, 450) + #pdb.gimp_paintbrush_default(drawable, 2, [x, y, x, y]) + Gimp.paintbrush_default(drawable, 2, [x, y, x, y]) + + x += 1 + x = 0 + y += 1 + + + + + + #return pixbuf + +def plugin_func(procedure, run_mode, image, drawable, config, data): + + width = image.width + height = image.height + #duplicate_image = pdb.gimp_image_duplicate(image) + #duplicate_drawable = pdb.gimp-image-get-active-drawable(duplicate_image) + + if run_mode == Gimp.RunMode.INTERACTIVE: + GimpUi.init('przem-waved-cubism') + + dialog = GimpUi.ProcedureDialog(procedure=procedure, config=config) + dialog.fill(None) + if not dialog.run(): + dialog.destroy() + return procedure.new_return_values(Gimp.PDBStatusType.CANCEL, GLib.Error()) + else: + dialog.destroy() + + color = config.get_property('color') + + + + # Dodaj skopiowany obraz do listy obrazów w GIMPie + #gimp.Display(duplicate_image) + + Gimp.context_push() + image.undo_group_start() + + #pdb.gimp-selection-none(duplicate_image) + #pdb.gimp-context-push() + #pdb.gimp-context-set-defaults() + grid = [] + for y in range (0, height): + pix_width = [] + for x in range (0, width): + #pix_width.append(get_pixel_color(duplicate_drawable, x, y)) + pix_width.append(drawable.get_pixel(x, y)) + grid.append(pix_width) + + sincos = [] + for y in range (0, height): + pix_width = [] + for x in range (0, width): + pix_width.append((0, 0, 0)) + sincos.append(pix_width) + + sincos_func(grid, sincos) + create_pixbuf_from_rgb_tuples(drawable, sincos, width, height) + + Gimp.displays_flush() + + image.undo_group_end() + Gimp.context_pop() + + + return procedure.new_return_values(Gimp.PDBStatusType.SUCCESS, GLib.Error()) + + + +class WavedCubism (Gimp.PlugIn): + ## GimpPlugIn virtual methods ## + def do_set_i18n(self, procname): + return True, 'gimp30-python', None + + def do_query_procedures(self): + return ['przem-waved-cubism'] + + def do_create_procedure(self, name): + Gegl.init(None) + + _color = Gegl.Color.new("black") + _color.set_rgba(0.94, 0.71, 0.27, 1.0) + + procedure = Gimp.Procedure.new(self, name, + Gimp.PDBProcType.PLUGIN, + plugin_func, None) + + if procedure is not None: + + procedure.set_image_types("RGB*, GRAY*") + + + procedure.set_menu_label(_("Make waved cubism on image")) + procedure.set_documentation ('Make waved cubism on image', + 'Make waved cubism on image', + name) + + procedure.set_attribution("Przemysław R. Pietraszczyk", + "Public Domain", "2025-03-04") + + + #procedure.add_string_argument ("name", _("Layer _name"), _("Layer name"), + # _("Clouds"), GObject.ParamFlags.READWRITE) + + procedure.add_color_argument ("color", _("_BG color"), _("BG color"), + True, _color, GObject.ParamFlags.READWRITE) + + procedure.add_menu_path ("<Image>/Filters/PIETRASZCZYK") + + return procedure + +Gimp.main(WavedCubism.__gtype__, sys.argv) + diff --git a/script-fu/2.10/przem-add-background-under-text.scm b/script-fu/2.10/przem-add-background-under-text.scm new file mode 100644 index 0000000..9b9c977 --- /dev/null +++ b/script-fu/2.10/przem-add-background-under-text.scm @@ -0,0 +1,83 @@ +; przem-add-background-under-text - Script-fu dodający podpis z tłem
+; author: PRP
+; licencja: Public Domain
+; Gdańsk - 06-02-2025
+; ver. 1.250209-1
+
+(define (przem-add-background-under-text image drawable text font font-size color background-transparency opacity)
+
+ (gimp-image-undo-group-start image)
+
+ (let* (
+ (image-width (car (gimp-image-width image)))
+ (image-height (car (gimp-image-height image)))
+ (text-extents (gimp-text-get-extents-fontname text font-size 0 font))
+ (text-width (car text-extents))
+ (text-height (cadr text-extents))
+ (pos-x (- (- image-width text-width) 40))
+ (pos-y (- image-height text-height))
+ (bg-x-left (- pos-x 10))
+ (bg-x-right (+ text-width 10))
+ (text-layer (car (gimp-text-fontname image -1 0 0 text 0 TRUE font-size 0 font)))
+ (bg-layer (car (gimp-layer-new image bg-x-right text-height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
+ (is-nocolorful (car (gimp-drawable-is-gray drawable))) ; czy obraz jest w odcieniach szarości
+ )
+
+ ; Ustawienie koloru tła
+ (gimp-context-set-background color)
+ (gimp-drawable-fill bg-layer BACKGROUND-FILL)
+ (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)
+ )
+
+ ; Dodanie warstwy tła pod tekstem
+ (gimp-image-insert-layer image bg-layer 0 -1)
+ ;(gimp-image-add-layer image new-layer 0)
+ (gimp-layer-translate bg-layer bg-x-left pos-y)
+
+ (if (= background-transparency TRUE)
+ (begin
+ (gimp-drawable-fill bg-layer TRANSPARENT-FILL)
+ )
+ (begin ; else
+ )
+ )
+
+ ; Ustawienie pozycji tekstu
+ (gimp-layer-set-offsets text-layer pos-x pos-y)
+
+ ; Przesuń warstwę tekstową na górę stosu warstw
+ (gimp-image-raise-item-to-top image text-layer)
+
+ ; Scalanie warstw
+ (gimp-image-merge-down image text-layer CLIP-TO-IMAGE)
+
+ ; Aktualizacja widoku
+ (gimp-displays-flush)
+
+ (gimp-image-undo-group-end image) ; Zakończ grupę operacji undo
+ )
+)
+
+(script-fu-register "przem-add-background-under-text"
+ _"Add Background Under Text"
+ _"Dodaje kolorowe tło pod tekstem z możliwością wyboru czcionki i rozmiaru."
+ "Przemysław R. Pietraszczyk"
+ "Public Domain"
+ "2025-02-06"
+ "RGB* GRAY*"
+ SF-IMAGE "Image" 0
+ SF-DRAWABLE "Drawable" 0
+ SF-STRING "Text" "Doda Elektroda"
+ SF-FONT "Font" "Sans-serif"
+ SF-ADJUSTMENT "Font Size" '(50 1 1000 1 10 0 1)
+ SF-COLOR "Background Color" '(255 215 0)
+ SF-TOGGLE "Background Transparency" FALSE
+ SF-ADJUSTMENT "Transparency Value" '(100 1 100 1 10 0 1)
+)
+
+(script-fu-menu-register "przem-add-background-under-text"
+ "<Image>/Filters/PIETRASZCZYK/")
diff --git a/script-fu/2.10/przem-apply-cents-effect.scm b/script-fu/2.10/przem-apply-cents-effect.scm new file mode 100644 index 0000000..e8c9958 --- /dev/null +++ b/script-fu/2.10/przem-apply-cents-effect.scm @@ -0,0 +1,47 @@ +; apply-cents-effect - Script-fu dodający efekt cętek +; author: PRP +; licencja: Public Domain +; Gdańsk - 26-02-2025 +; ver. 1.250223-0 + +(define (przem-apply-cents-effect image drawable bright azimuth elevation depth polish) + + (let* ( + (width (car (gimp-image-width image))) + (height (car (gimp-image-height image))) + (bump-map (car (gimp-image-get-active-layer image))) + ) + (gimp-image-undo-group-start image) + + (plug-in-solid-noise RUN-NONINTERACTIVE image drawable 0 0 0 1 5 5) + (plug-in-bump-map RUN-NONINTERACTIVE image drawable bump-map azimuth elevation depth 0 0 0 0 TRUE FALSE 0) + (if (= polish 0) (gimp-curves-spline drawable 0 18 #(0 255 30 0 65 255 95 0 125 255 160 0 190 255 222 0 255 255)));max + (if (= polish 1) (gimp-curves-spline drawable 0 14 #(0 0 31 193 79 30 127 255 191 94 222 255 255 185)));med + (if (= polish 2) (gimp-curves-spline drawable 0 14 #(0 0 32 160 94 63 127 223 190 161 222 255 255 255)));soft + (gimp-brightness-contrast drawable bright bright) + (gimp-selection-invert image) + + (gimp-image-undo-group-end image) + (gimp-displays-flush) + ) +) + + +(script-fu-register "przem-apply-cents-effect" + _"Apply a cents effect to the image." + _"Dodaje efekt cętek do zdjęcia" + "Przenmysław R. Pietraszczyk" + "Public Domain" + "2025-02-23" + "RGB*, GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT "Bright" '(50 0 100 1 10 0 0) + SF-ADJUSTMENT "Azimuth" '(360 0 360 1 10 0 0) + SF-ADJUSTMENT "Elevation" '(45 0 90 1 10 0 0) + SF-ADJUSTMENT "Depth" '(5 1 50 1 10 0 0) + SF-OPTION "Polish" '("MAX" "MED" "MIN") + +) + +(script-fu-menu-register "przem-apply-cents-effect" "<Image>/Filters/PIETRASZCZYK/") diff --git a/script-fu/2.10/przem-apply-sepia.scm b/script-fu/2.10/przem-apply-sepia.scm new file mode 100644 index 0000000..449d627 --- /dev/null +++ b/script-fu/2.10/przem-apply-sepia.scm @@ -0,0 +1,91 @@ +; przem-apply-sepia - Script-fu dodający prawdziwą sepie do zdjęcia +; author: PRP +; licencja: Public Domain +; Gdańsk - 07-02-2025 +; ver. 1.250213-0 + +(define (przem-apply-sepia image drawable value-slider-sepia gradient-reverse gradient-shape) + + (let* ( + (image-width (car (gimp-image-width image))) + (image-height (car (gimp-image-height image))) + (center-x (/ image-width 2)) + (center-y (* image-height 0.5)) ; either is OK + (sepia-layer (car (gimp-layer-new image image-width image-height RGBA-IMAGE "Sepia Layer" 100 NORMAL-MODE))) + (is-nocolorful (car (gimp-drawable-is-gray drawable))) ; czy obraz jest w odcieniach szarości + (radius (sqrt (+ (* center-x center-x) (* center-y center-y)))) + ) + + (gimp-image-undo-group-start 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) + + ; Dodanie koloru sepii + (gimp-context-set-foreground '(112 66 20)) ; Kolor sepii + (gimp-context-set-background '(233 213 186)) ; Kolor sepii + + + (gimp-image-insert-layer image sepia-layer 0 -1) + + (gimp-selection-all image) + + (if (= gradient-reverse TRUE) + (begin + + (if (= gradient-shape TRUE) + (begin + (gimp-edit-blend sepia-layer FG-BG-RGB-MODE NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE TRUE 3 0 TRUE 0 0 image-width image-height) + ) + (begin + (gimp-edit-blend sepia-layer CUSTOM-MODE NORMAL-MODE + GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE + FALSE 0 0 TRUE + center-x center-y radius 0) + ) ) ) + (begin + + (if (= gradient-shape TRUE) + (begin + (gimp-edit-blend sepia-layer FG-BG-RGB-MODE NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE TRUE 3 0 TRUE 0 0 image-width image-height) + ) + (begin + (gimp-edit-blend sepia-layer CUSTOM-MODE NORMAL-MODE + GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE + FALSE 0 0 TRUE + center-x center-y radius 0) + ) ) ) ) + + + ; ) + ; Zmiana krycia warstwy + (gimp-layer-set-opacity sepia-layer value-slider-sepia) + + (gimp-image-merge-down image sepia-layer CLIP-TO-IMAGE) + + (gimp-image-undo-group-end image) + + (gimp-displays-flush) +) ) + +(script-fu-register "przem-apply-sepia" + _"Apply a sepia effect to the image" + _"Tworzy obraz sepii" + "Przemyslaw R. Pietraszczyk" + "Public Domain" + "2025-02-07" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT "Sepia intensity" '(50 0 100 1 10 0 0) + SF-TOGGLE "Gradient reverse" FALSE + SF-TOGGLE "Shape" TRUE +) + +(script-fu-menu-register "przem-apply-sepia" + "<Image>/Filters/PIETRASZCZYK/") diff --git a/script-fu/2.10/przem-apply-waves-effect.scm b/script-fu/2.10/przem-apply-waves-effect.scm new file mode 100644 index 0000000..5ded293 --- /dev/null +++ b/script-fu/2.10/przem-apply-waves-effect.scm @@ -0,0 +1,96 @@ +; apply-waves-effect - Script-fu dodający efekt falowania +; author: PRP +; licencja: Public Domain +; Gdańsk - 25-02-2025 +; ver. 1.250225-2 + +(define (przem-apply-waves-effect image drawable amplitude frequency phase) + (let* ( + (width (car (gimp-image-width image))) + (height (car (gimp-image-height image))) + (new-image (car (gimp-image-duplicate image))) + (new-drawable (car (gimp-image-get-active-drawable new-image))) + (resize-y 0) + (resize-x 0) + (y 0) + (x 0) + (counter 0)) + (gimp-selection-none new-image) + + (gimp-context-push) + (gimp-context-set-defaults) + + ; 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-image-get-active-drawable new-image))) + + (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))) + ) + (gimp-context-set-foreground color) + ;(gimp-brushes-refresh) + (gimp-context-set-brush "Circle (01)") + (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-pencil new-drawable 2 (vector new-x new-y)) ; 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 "przem-apply-waves-effect" + _"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-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-VALUE "Amplitude" "10" + SF-VALUE "Frequency" "0.1" + SF-VALUE "Phase" "0" +) + +(script-fu-menu-register "przem-apply-waves-effect" "<Image>/Filters/PIETRASZCZYK") diff --git a/script-fu/2.10/przem-cyanotype-gum-effect-multi.scm b/script-fu/2.10/przem-cyanotype-gum-effect-multi.scm new file mode 100644 index 0000000..9603815 --- /dev/null +++ b/script-fu/2.10/przem-cyanotype-gum-effect-multi.scm @@ -0,0 +1,55 @@ +; przem-cyanotype-gum-effect-multi - Efekty cyjanotypii i gumy dwuchromianowej +; author: PRP +; licencja: Public Domain +; Gdańsk - 18-06-2025 +; ver. 2.250618-1 + +(define (przem-cyanotype-gum-effect-multi img drawable blue grain) + ;(gimp-image-undo-group-start img) + + (gimp-context-push) + (gimp-image-undo-group-start img) + + ; Cyjanotypia (zostaw tylko niebieski kanał) + (let* ( + (cyan-layer (car (gimp-layer-copy drawable TRUE)))) + (gimp-image-insert-layer img cyan-layer 0 -1) + (gimp-item-set-name cyan-layer "Cyanotype") + (gimp-layer-set-mode cyan-layer LAYER-MODE-SCREEN) ; Tryb mieszania: Screen + (plug-in-colors-channel-mixer TRUE img cyan-layer TRUE 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 1.0) + ;(gimp-invert cyan-layer) + (gimp-hue-saturation cyan-layer 0 blue 50 0) + ) + + + + ; Guma dwuchromianowa (sepia + ziarno) + (let* ( + (gum-layer (car (gimp-layer-copy drawable TRUE)))) + (gimp-image-insert-layer img gum-layer 0 -1) + (gimp-item-set-name gum-layer "Gum Bichromate") + (gimp-layer-set-mode gum-layer LAYER-MODE-OVERLAY) ; Tryb mieszania: Overlay + (gimp-hue-saturation gum-layer 0 40 25 0) ; Brązowy odcień + (plug-in-noisify TRUE img gum-layer FALSE grain grain grain 0) ; Lekkie ziarno 0.1 + ) + + (gimp-image-undo-group-end img) + (gimp-displays-flush) + (gimp-context-pop)) + + +(script-fu-register "przem-cyanotype-gum-effect-multi" + _"Add Cyanotype+Gum Multi..." + _"Efekty cyjanotypii i gumy dwuchromianowej" + "PRP" + "Public Domain" + "2025-06-18" + "RGB*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT "Pastel blue" '(40 30 70 1 10 1 0) + SF-ADJUSTMENT "Grain" '(0.1 0 1 0.1 0.1 2 0)) + +(script-fu-menu-register "przem-cyanotype-gum-effect-multi" + "<Image>/Filters/PIETRASZCZYK/") + diff --git a/script-fu/2.10/przem-cyanotype-gum-effect.scm b/script-fu/2.10/przem-cyanotype-gum-effect.scm new file mode 100644 index 0000000..551c89f --- /dev/null +++ b/script-fu/2.10/przem-cyanotype-gum-effect.scm @@ -0,0 +1,33 @@ +; przem-cyanotype-gum-effect - Tworzy efekt zastosowania cyjanotypi wraz z gumą dwuchromianową +; author: PRP +; licencja: Public Domain +; Gdańsk - 18-09-2025 +; ver. 2.250618-0 + +(define (przem-cyanotype-gum-effect img drawable) + (gimp-context-push) + (gimp-image-undo-group-start img) + + ; Cyjanotypia + (plug-in-colors-channel-mixer TRUE img drawable TRUE 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 1.0) ; Tylko niebieski kanał + + ; Efekt gumy + (gimp-colorize drawable 40 25 0) ; Brązowe barwienie + + (gimp-image-undo-group-end img) + (gimp-displays-flush) + (gimp-context-pop)) + + +(script-fu-register "przem-cyanotype-gum-effect" + _"Add Cyanotype+Gum..." + _"Łączy efekt cyjanotypii i gumy dwuchromianowej" + "PRP" + "Public Domain" + "2025-06-18" + "RGB*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0) + +(script-fu-menu-register "przem-cyanotype-gum-effect" + "<Image>/Filters/PIETRASZCZYK/") diff --git a/script-fu/2.10/przem-expired-negative.scm b/script-fu/2.10/przem-expired-negative.scm new file mode 100644 index 0000000..c939db2 --- /dev/null +++ b/script-fu/2.10/przem-expired-negative.scm @@ -0,0 +1,222 @@ +; przem-expired-negative - luźne nawiązanie do przeterminowanego negatywu ORWO
+; author: PRP
+; licencja: Public Domain
+; Gdańsk - 22-05-2025
+; ver. 2.250610-5~beta
+
+(define (is-portrait? image)
+ (let* ((width (car (gimp-image-width image)))
+ (height (car (gimp-image-height image)))
+ (ratio (/ (min width height) (max width height))))
+
+ ; Jeśli stosunek boków jest większy niż 0.7 i wysokość > szerokości
+ ;(and (> ratio 0.7) (> height width))
+ (> height width)
+ )
+)
+
+
+(define (portrait image fog-layer-right fog-layer-left position-right width cut-left density color)
+
+ ; PORTRET
+ ; prawa strona
+ ; Dodaj nową warstwę dla mgły
+ (gimp-image-insert-layer image fog-layer-right 0 -1)
+
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+
+ ; Wypełnij warstwę przezroczystością
+ (gimp-drawable-fill fog-layer-right FILL-TRANSPARENT)
+
+ ; Utwórz gradient od przezroczystego do białego (mgła)
+ (gimp-edit-blend fog-layer-right BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ position-right 0 ; X1 = 3/4 szerokości
+ width 0) ; X2 = pełna szerokość
+
+ ; Lekko rozmyj mgłę dla naturalnego efektu
+ (plug-in-gauss 1 image fog-layer-right density density 1) ; dostosuj wartość rozmycia (8)
+
+ ; Ustaw maskę warstwy, aby stopniowo zanikała
+ (let ((mask (car (gimp-layer-create-mask fog-layer-right ADD-MASK-WHITE))))
+ (gimp-layer-add-mask fog-layer-right mask)
+
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+ (gimp-edit-blend mask BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ position-right 0
+ width 0))
+
+
+
+
+ ;lewa strona
+ ; Dodaj nową warstwę dla mgły
+ (gimp-image-insert-layer image fog-layer-left 0 -1)
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+
+ ; Wypełnij warstwę przezroczystością
+ (gimp-drawable-fill fog-layer-left FILL-TRANSPARENT)
+
+ ; Utwórz gradient od przezroczystego do białego (mgła)
+ (gimp-edit-blend fog-layer-left BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ cut-left 0 0 0)
+
+ ; Lekko rozmyj mgłę dla naturalnego efektu
+ (plug-in-gauss 1 image fog-layer-left density density 1) ; dostosuj wartość rozmycia (8)
+
+ ; Ustaw maskę warstwy, aby stopniowo zanikała
+ (let ((mask (car (gimp-layer-create-mask fog-layer-left ADD-MASK-WHITE))))
+ (gimp-layer-add-mask fog-layer-left mask)
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+
+ (gimp-edit-blend mask BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ cut-left 0 0 0))
+
+
+)
+
+(define (landscape image fog-layer-up fog-layer-bottom width height cut-up size density color)
+
+ ; KRAJOBRAZ
+ ; dól
+ ; Dodaj nową warstwę dla mgły
+ (gimp-image-insert-layer image fog-layer-up 0 -1)
+
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+
+ ; Wypełnij warstwę przezroczystością
+ (gimp-drawable-fill fog-layer-up FILL-TRANSPARENT)
+
+ ; Utwórz gradient od przezroczystego do białego (mgła)
+ (gimp-edit-blend fog-layer-up BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ 0 (- height cut-up) 0 height) ; size
+
+ ; Lekko rozmyj mgłę dla naturalnego efektu
+ (plug-in-gauss 1 image fog-layer-up density density 1) ; dostosuj wartość rozmycia (8)
+
+ ; Ustaw maskę warstwy, aby stopniowo zanikała
+ (let ((mask (car (gimp-layer-create-mask fog-layer-bottom ADD-MASK-WHITE))))
+ (gimp-layer-add-mask fog-layer-up mask)
+
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+ (gimp-edit-blend mask BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ 0 (- height cut-up) 0 height)) ; size
+
+
+
+ ; gora
+ ; Dodaj nową warstwę dla mgły
+ (gimp-image-insert-layer image fog-layer-bottom 0 -1)
+
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+
+ ; Wypełnij warstwę przezroczystością
+ (gimp-drawable-fill fog-layer-bottom FILL-TRANSPARENT)
+
+ ; Utwórz gradient od przezroczystego do białego (mgła)
+ (gimp-edit-blend fog-layer-bottom BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ 0 cut-up
+ 0 0)
+
+ ; Lekko rozmyj mgłę dla naturalnego efektu
+ (plug-in-gauss 1 image fog-layer-bottom density density 1) ; dostosuj wartość rozmycia (8)
+
+ ; Ustaw maskę warstwy, aby stopniowo zanikała
+ (let ((mask (car (gimp-layer-create-mask fog-layer-bottom ADD-MASK-WHITE))))
+ (gimp-layer-add-mask fog-layer-bottom mask)
+
+ (gimp-context-set-background color)
+ (gimp-context-set-foreground '(#x0 #x0 #x0)) ; mgła jest biała/szara
+ (gimp-edit-blend mask BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
+ GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
+ FALSE 0 0 TRUE
+ 0 cut-up
+ 0 0))
+
+
+
+)
+
+
+(define (przem-expired-negative image drawable size density color)
+ (let* (
+ (width (car (gimp-image-width image)))
+ (height (car (gimp-image-height image)))
+ (frame-size-left size)
+ (frame-size-right (- 1 size))
+ (frame-size-up size)
+ (position-right (* width frame-size-right))
+ (position-left (* width frame-size-left))
+
+ (position-up (* height frame-size-up))
+ (num-size-up (/ height position-up))
+ (cut-up (- height (* position-up (- num-size-up 1))))
+ (is-colorful (car (gimp-drawable-is-rgb drawable))) ; czy obraz jest kolorowy
+
+ (num-size-left (/ width position-left))
+ (cut-left (- width (* position-left (- num-size-left 1)))) ; 3
+ (fog-layer-right (car (gimp-layer-new image width height GRAY-IMAGE "Fog-Right-Up" 100 LAYER-MODE-NORMAL)))
+ (fog-layer-left (car (gimp-layer-new image width height GRAY-IMAGE "Fog-Left-Bottom" 100 LAYER-MODE-NORMAL)))
+ )
+
+ (gimp-image-undo-group-start image)
+
+ (if (= is-colorful TRUE)
+ (gimp-image-convert-grayscale image)
+ )
+
+ (if (is-portrait? image)
+ (begin
+ ;(gimp-message (string-append "width: " (number->string width)))
+ ;(gimp-message (string-append "position-right: " (number->string position-right)))
+ ;(gimp-message (string-append "cut-left: " (number->string cut-left)))
+ (portrait image fog-layer-right fog-layer-left position-right width cut-left density color))
+ (begin
+ ;(gimp-message (string-append "height: " (number->string height)))
+ ;(gimp-message (string-append "size: " (number->string (* size 1000))))
+ ;(gimp-message (string-append "cut-up: " (number->string cut-up)))
+ (landscape image fog-layer-right fog-layer-left width height cut-up (* size 1000) density color))
+
+ )
+ (gimp-image-undo-group-end image) ;)
+
+ (gimp-displays-flush)
+ )
+)
+
+(script-fu-register "przem-expired-negative"
+ _"Convert photographs to photograph from expired negative"
+ _"Konwertuje na fotografie z przeterminowanego negatywu"
+ "Przemyslaw R. Pietraszczyk"
+ "Public Domain"
+ "2025-05-22"
+ "RGB* GRAY*"
+ SF-IMAGE "Image" 0
+ SF-DRAWABLE "Drawable" 0
+ SF-ADJUSTMENT "Size" '(0.20 0.05 0.50 0.01 0.01 2 0)
+ SF-ADJUSTMENT "Density" '(8 8 128 8 8 1 0)
+ SF-COLOR "Color" '(#x74 #x73 #x73) ;color variable
+)
+
+(script-fu-menu-register "przem-expired-negative"
+ "<Image>/Filters/PIETRASZCZYK/")
diff --git a/script-fu/2.10/przem-prussian-blue-effect.scm b/script-fu/2.10/przem-prussian-blue-effect.scm new file mode 100644 index 0000000..d469399 --- /dev/null +++ b/script-fu/2.10/przem-prussian-blue-effect.scm @@ -0,0 +1,57 @@ +; przem-prussian-blue-effect - nieudalna próba nawiązania do efektu cyjanotypii +; author: PRP +; licencja: Public Domain +; Gdańsk - 22-6-2025 +; ver. 2.250622-0~beta + +(define (przem-prussian-blue-effect img drawable mode invert value-blue) + + (let* ((gradient-layer (car (gimp-layer-new img (car (gimp-image-width img)) (car (gimp-image-height img)) RGBA-IMAGE "Prussian Blue" 50 NORMAL-MODE))) + (is-nocolorful (car (gimp-drawable-is-gray drawable)))) + + (gimp-image-undo-group-start img) + (gimp-context-push) + + ; jeśli obraz jest szary to konwertuje go na RGB - tak na sztukę + (if (= is-nocolorful TRUE) + (gimp-image-convert-rgb img) + ) + + (gimp-image-insert-layer img gradient-layer 0 -1) + (gimp-context-set-foreground '(0 51 102)) ; Kolor błękitu pruskiego + (gimp-context-set-background '(0 0 0)) + (if (= mode 0) (gimp-layer-set-mode gradient-layer OVERLAY-MODE)) + (if (= mode 1) (gimp-layer-set-mode gradient-layer SCREEN-MODE)) + + (plug-in-colors-channel-mixer TRUE img gradient-layer TRUE 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 1.0) + + ;(gimp-edit-blend gradient-layer FG-BG-RGB-MODE NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE FALSE 0 0 TRUE (car (gimp-image-width img)) (car (gimp-image-height img)) 0 0) + (gimp-edit-blend gradient-layer FG-BG-RGB-MODE NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE FALSE 0 0 TRUE 0 0 0 0) + + (if (= invert TRUE) (gimp-invert gradient-layer)) + + (gimp-layer-set-opacity gradient-layer value-blue) + (gimp-image-merge-down img gradient-layer CLIP-TO-IMAGE) + + (gimp-image-undo-group-end img) + (gimp-displays-flush) + (gimp-context-pop)) +) + +(script-fu-register "przem-prussian-blue-effect" + _"Apply prussian blue effect" + _"Nakłada efekt błękitu pruskiego na zdjęcie." + "PRP" + "Public Domain" + "2025-06-22" + "RGB*, GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-OPTION "Mode" '("OVERLAY MODE" "SCREEN MODE") + SF-TOGGLE "Invert Color" FALSE + SF-ADJUSTMENT "Blue intensity" '(50 0 100 1 10 0 0) + +) + +(script-fu-menu-register "przem-prussian-blue-effect" + "<Image>/Filters/PIETRASZCZYK/") diff --git a/script-fu/2.10/przem-soft-focus-noninteractive.scm b/script-fu/2.10/przem-soft-focus-noninteractive.scm new file mode 100644 index 0000000..f833adb --- /dev/null +++ b/script-fu/2.10/przem-soft-focus-noninteractive.scm @@ -0,0 +1,32 @@ +; przem-soft-focus-noninteractive - Tworzy efekt miękkiego focusa +; author: PRP +; licencja: Public Domain +; Gdańsk - 15-09-2025 +; ver. 2.250615-0 + +(define (przem-soft-focus-noninteractive filename file-name blur-radius opacity) + + (let* ( + (img (car (gimp-file-load RUN-NONINTERACTIVE filename file-name))) + (drawable (car (gimp-image-get-active-layer img))) + (soft-layer (car (gimp-layer-copy drawable FALSE))) + ) + + (gimp-image-insert-layer img soft-layer 0 -1) + (gimp-item-set-name soft-layer "Soft Focus") + + ; Rozmycie Gaussa + (plug-in-gauss 1 img soft-layer blur-radius blur-radius 0) + + ; Zmień tryb mieszania na Overlay lub Screen + (gimp-layer-set-mode soft-layer OVERLAY-MODE) + + ; Dostosuj przezroczystość + (gimp-layer-set-opacity soft-layer opacity) + ;(gimp-image-merge-down img soft-layer CLIP-TO-IMAGE) + + (gimp-file-save RUN-NONINTERACTIVE img drawable file-name filename) + (gimp-image-delete img) + +)) + diff --git a/script-fu/2.10/przem-soft-focus.scm b/script-fu/2.10/przem-soft-focus.scm new file mode 100644 index 0000000..055e988 --- /dev/null +++ b/script-fu/2.10/przem-soft-focus.scm @@ -0,0 +1,49 @@ +; przem-soft-focus - Tworzy efekt miękkiego focusa +; author: PRP +; licencja: Public Domain +; Gdańsk - 15-09-2025 +; ver. 2.250615-0 + +(define (przem-soft-focus img drawable blur-radius opacity) + + (let* ( + (soft-layer (car (gimp-layer-copy drawable FALSE))) + ) + (gimp-context-push) + (gimp-image-undo-group-start img) + + (gimp-image-insert-layer img soft-layer 0 -1) + (gimp-item-set-name soft-layer "Soft Focus") + + ; Rozmycie Gaussa + (plug-in-gauss 1 img soft-layer blur-radius blur-radius 0) + + ; Zmień tryb mieszania na Overlay lub Screen + (gimp-layer-set-mode soft-layer OVERLAY-MODE) + + ; Dostosuj przezroczystość + (gimp-layer-set-opacity soft-layer opacity) + (gimp-image-merge-down img soft-layer CLIP-TO-IMAGE) + + + (gimp-image-undo-group-end img) + (gimp-displays-flush) + (gimp-context-pop) +)) + +; Rejestracja skryptu w menu GIMP +(script-fu-register "przem-soft-focus" + _"Apply a Soft Focus..." + _"Tworzy efekt miękkiego focusu" + "PRP" + "Public Domain" + "2025-06-15" + "RGB*, GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT "Blur (px)" '(15 1 100 1 10 0 1) + SF-ADJUSTMENT "Transparency (%)" '(50 0 100 1 10 0 1) +) + +(script-fu-menu-register "przem-soft-focus" + "<Image>/Filters/PIETRASZCZYK/") diff --git a/script-fu/2.10/przem-traditional-photo.scm b/script-fu/2.10/przem-traditional-photo.scm new file mode 100644 index 0000000..a43ef58 --- /dev/null +++ b/script-fu/2.10/przem-traditional-photo.scm @@ -0,0 +1,52 @@ +; przem-traditional-photo - luźne nawiązanie do chemii tradycyjnej fototgrafii +; author: PRP +; licencja: Public Domain +; Gdańsk - 15-02-2025 +; ver. 2.250217-0~beta + +(define (cross drawable) + ; crossing photo + (gimp-curves-spline drawable HISTOGRAM-VALUE 10 #(0 0 64 90 128 160 192 230 255 255)) + (gimp-curves-spline drawable HISTOGRAM-RED 10 #(0 0 64 50 128 180 192 230 255 255)) + (gimp-curves-spline drawable HISTOGRAM-GREEN 10 #(0 0 64 80 128 120 192 200 255 255)) + (gimp-curves-spline drawable 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) +) + +(define (przem-traditional-photo image drawable crossing contrast-colors contrast balance-color) + + (gimp-image-undo-group-start image) + + (if (= crossing TRUE) + (cross drawable)) + ;(if (= grain TRUE) + ; (gimp-noise-hurl drawable 1 0.02)) + (if (= contrast-colors TRUE) + ; Zmniejsz kontrast i dodaj kolor + (gimp-brightness-contrast drawable 10 contrast) + (gimp-color-balance drawable FALSE 0 balance-color 0 10)) + + (gimp-image-undo-group-end image) + (gimp-displays-flush) +) + +(script-fu-register "przem-traditional-photo" + _"Convert photographs to neotraditional" + _"Konwertuje na neotradycyjną fotografię" + "Przemyslaw R. Pietraszczyk" + "Public Domain" + "2025-02-15" + "RGB*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-TOGGLE "Crossing" FALSE + ;SF-TOGGLE "Grain" FALSE + SF-TOGGLE "Contrast and Color corection" TRUE + SF-ADJUSTMENT "Contrast" '(-30 -100 100 1 1 0 0) + SF-ADJUSTMENT "Balance Color" '(-5 -100 100 1 1 0 0) +) + +(script-fu-menu-register "przem-traditional-photo" + "<Image>/Filters/PIETRASZCZYK/") diff --git a/script-fu/3.0/przem-add-background-under-text-v3.scm b/script-fu/3.0/przem-add-background-under-text-v3.scm new file mode 100644 index 0000000..943e00c --- /dev/null +++ b/script-fu/3.0/przem-add-background-under-text-v3.scm @@ -0,0 +1,96 @@ +; przem-add-background-under-text-v3 - Script-fu dodający podpis z tłem
+; author: PRP
+; licencja: Public Domain
+; Gdańsk - 06-02-2025
+; 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)
+
+ (gimp-image-undo-group-start image)
+
+ (let* (
+ (image-width (car (gimp-image-get-width image)))
+ (image-height (car (gimp-image-get-height image)))
+ ;(text-extents (gimp-text-get-extents-fontname text font-size 0 font))
+ (text-extents (gimp-text-get-extents-font text font-size font))
+ (text-width (car text-extents))
+ (text-height (cadr text-extents))
+ (pos-x (- (- image-width text-width) 40))
+ (pos-y (- image-height text-height))
+ (bg-x-left (- pos-x 10))
+ (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 "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
+ (gimp-context-set-background bg-color)
+ (gimp-context-set-foreground fg-color)
+
+ (gimp-drawable-fill bg-layer FILL-BACKGROUND)
+ (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)
+ ;)
+ ; 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)
+ (if (= background-transparency TRUE)
+ (begin
+ (gimp-drawable-fill bg-layer FILL-TRANSPARENT)
+ )
+ (begin ; else
+ )
+ )
+
+ ; Ustawienie pozycji tekstu
+ (gimp-layer-set-offsets text-layer pos-x pos-y)
+
+ ; Przesuń warstwę tekstową na górę stosu warstw
+ (gimp-image-raise-item-to-top image text-layer)
+
+ ; Scalanie warstw
+ (gimp-image-merge-down image text-layer CLIP-TO-IMAGE)
+
+ ; Aktualizacja widoku
+ (gimp-displays-flush)
+
+ (gimp-image-undo-group-end image) ; Zakończ grupę operacji undo
+ )
+)
+
+(script-fu-register "przem-add-background-under-text-v3"
+ _"Add Background Under Text"
+ _"Dodaje kolorowe tło pod tekstem z możliwością wyboru czcionki i rozmiaru."
+ "Przemysław R. Pietraszczyk"
+ "Public Domain"
+ "2025-02-06"
+ "RGB* GRAY*"
+ SF-IMAGE "Image" 0
+ SF-DRAWABLE "Drawable" 0
+ SF-STRING "Text" "Doda Elektroda"
+ SF-FONT "Font" "Monospace"
+ SF-ADJUSTMENT "Font Size" (list 50 1 1000 1 10 0 1)
+ SF-COLOR "Foreground Color" (list 100 100 100)
+ SF-COLOR "Background Color" (list 255 215 0)
+ SF-TOGGLE "Background Transparency" FALSE
+ SF-ADJUSTMENT "Transparency Value" (list 100 1 100 1 10 0 1)
+)
+
+(script-fu-menu-register "przem-add-background-under-text-v3"
+ "<Image>/Filters/PIETRASZCZYK/")
diff --git a/script-fu/3.0/przem-apply-sepia-v3.scm b/script-fu/3.0/przem-apply-sepia-v3.scm new file mode 100644 index 0000000..aa495b7 --- /dev/null +++ b/script-fu/3.0/przem-apply-sepia-v3.scm @@ -0,0 +1,154 @@ +; przem-apply-sepia-v3 - Script-fu dodający prawdziwą sepie do zdjęcia +; author: PRP +; licencja: GPL v3 +; Gdańsk - 07-02-2025 +; ver. 2.2502022-0~beta for GIMP 3 +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; + +(define (przem-apply-sepia-v3 image drawable value-slider-sepia shadow-sepia gradient-reverse in-sepia gradient-shape) + (let* ( + (image-width (car (gimp-image-get-width image))) + (image-height (car (gimp-image-get-height image))) + (layer (vector-ref drawable 0)) + (type (car (gimp-drawable-type layer))) + (center-x (/ image-width 2)) + (center-y (/ image-height 2)) + (radius (sqrt (+ (* center-x center-x) (* center-y center-y)))) + (the-layer 0) + ) + + (gimp-image-undo-group-start image) + ;(gimp-image-undo-disable image) + + ; TODO - z kodu old-photo wynika że nie trzeba konwertować na RGB - mimo tego kod nie dziala jak należy + ; 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 ... + ;(if (> (car (gimp-drawable-type (vector-ref drawable 0))) 1 ) + ; (gimp-image-convert-rgb image)) + + (gimp-selection-all image) + (set! the-layer (car (gimp-image-flatten image))) + + ; Konwersja obrazu do skali szarości + ;(if (= type RGB-IMAGE) + ;(gimp-drawable-desaturate the-layer DESATURATE-LIGHTNESS) + ;) + + (if (= in-sepia TRUE) + (begin (gimp-drawable-desaturate the-layer DESATURATE-LIGHTNESS) + (gimp-drawable-brightness-contrast the-layer -0.078125 -0.15625) + (gimp-drawable-color-balance the-layer TRANSFER-SHADOWS TRUE 30 0 -30) + ) + ) + + (let ( + (sepia-layer (car (gimp-layer-new image "Sepia" image-width image-height RGB-IMAGE 100 LAYER-MODE-NORMAL))) + ) + + (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 + + ; 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) + + (gimp-context-pop) + + (gimp-context-push) + + ;(gimp-selection-all image) + ; tak było w v. 2.10 + ;(gimp-edit-blend sepia-layer FG-BG-RGB-MODE NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE TRUE 3 0 TRUE 0 0 image-width image-height) + (gimp-context-set-gradient-fg-bg-rgb) + (if (= gradient-shape 1) + (begin + (gimp-context-set-gradient-reverse gradient-reverse) + (gimp-drawable-edit-gradient-fill sepia-layer + GRADIENT-LINEAR (- 100 shadow-sepia) + FALSE 1 0 + TRUE + 0 0 image-width image-height) + ) ) + (if (= gradient-shape 2) + (begin + (gimp-context-set-gradient-reverse gradient-reverse) + (gimp-drawable-edit-gradient-fill sepia-layer + GRADIENT-SHAPEBURST-DIMPLED (- 100 shadow-sepia) + FALSE 1 0 + TRUE + 0 0 center-x center-y) + ) + ) + (if (= gradient-shape 0) + (begin + (gimp-context-set-gradient-reverse gradient-reverse) + (gimp-drawable-edit-gradient-fill sepia-layer + GRADIENT-BILINEAR (- 100 shadow-sepia) + FALSE 1 0 + TRUE + (/ (+ (* 2 center-x) center-y -1) 2) 0 + 0 0) + ) + ) + + (gimp-context-pop) + + + ; Zmiana krycia warstwy + (gimp-layer-set-opacity sepia-layer value-slider-sepia) + + (gimp-image-merge-down image sepia-layer CLIP-TO-IMAGE) + ) ; let + (gimp-selection-none image) + + + (gimp-image-undo-group-end image) + ;(gimp-image-undo-enable image) + + (gimp-displays-flush) +) ) + +(script-fu-register-filter "przem-apply-sepia-v3" + _"_Apply a sepia effect to the image" + _"Tworzy obraz sepii" + "Przemyslaw R. Pietraszczyk" + "GPL v3" + "2025-02-07" + "RGB* GRAY*" + SF-ONE-OR-MORE-DRAWABLE + SF-ADJUSTMENT _"Sepia intensity" '(50 0 100 1 10 0 0) ; Suwak poziomy + SF-ADJUSTMENT _"Shadow Sepia" '(30 0 100 1 10 0 0) ; Suwak poziomy + SF-TOGGLE _"Gradient reverse" FALSE + SF-TOGGLE _"Sepia" TRUE + SF-OPTION _"Shape" '("Bilinear" "Linear" "Shapeburst") + + + +) + +(script-fu-menu-register "przem-apply-sepia-v3" + "<Image>/Filters/PIETRASZCZYK/") diff --git a/script-fu/3.0/przem-soft-focus-noninteractive-v3.scm b/script-fu/3.0/przem-soft-focus-noninteractive-v3.scm new file mode 100644 index 0000000..98d5ed0 --- /dev/null +++ b/script-fu/3.0/przem-soft-focus-noninteractive-v3.scm @@ -0,0 +1,54 @@ +; przem-soft-focus-noninteractive-v3.sh - 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-v3 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/3.0/przem-traditional-photo-v3.scm b/script-fu/3.0/przem-traditional-photo-v3.scm new file mode 100644 index 0000000..ee9b727 --- /dev/null +++ b/script-fu/3.0/przem-traditional-photo-v3.scm @@ -0,0 +1,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/") diff --git a/script-fu/changelog.md b/script-fu/changelog.md new file mode 100644 index 0000000..bca2d9e --- /dev/null +++ b/script-fu/changelog.md @@ -0,0 +1,129 @@ +# [2.250622-0] przem-prossian-blue-effect.scm
+* Dodane filtra imitującego "pruski błękit"
+
+# [2.250619-3] przem-soft-focus-noninteractive-v3.scm
+* Dodanie filtra wywolywanego z linii poleceń - nie uruchamia się
+
+# [2.250618-0] przem-cyanotype-gum-effect.scm
+* Dodanie efektu zastosowania cyjanotypi wraz z gumą dwuchromianową\
+
+# [2.250616-0] przem-soft-focus-noninteractive.scm
+* Dodanie filtra wywolywanego z linii poleceń
+
+# [2.250615-0] przem-soft-focus.scm
+* Dodanie filtra "miękkiego focusa' - w nawiązaniu do piktorializmu
+
+# [2.250610-4] przem-expired-negative.scm
+* Konwersja z RGB na colorspace Gray
+
+# [2.250610-3] przem-expired-negative.scm
+* Dzielnik mgły, zwiększony do 0.50
+
+# [2.250610-2] przem-expired-negative.scm
+* Dodanie suwaka density
+
+# [2.250610-1] przem-expired-negative.scm
+* Przy odwolywaniu się do wspólnej funkcji gradientu - filtr dzialą nieprawidlowo
+* Możliwa zmiana odcieniu gradientu (background)
+
+# [2.250608-3] przem-expired-negative.scm
+* Dodaje efekt prawidłowo, zarówno na dole jak i na górze
+
+# [2.250608-2] przem-expired-negative.scm
+* Dodaje efekt expire ORWO do poziomego zdjęcia, jednak nie równomiernie
+
+# [2.250525-1] przem-expired-negative.scm
+* Rozróżnia rodzaj obrazu. Jednak prawidłowo przetwarza jedynie póki co portrety
+
+# [2.250522-4] przem-expired-negative.scm
+* Mgła jest prawidłowo rozmieszczana po przegach
+
+# [2.250522-0] przem-expired-negative.scm
+* Filtr imitujący przetermonowany negatyw ORWO - Inicjacja
+
+# [2.250225-2] przem-apply-waves-effect.scm
+* Filtr, działać, działa. Jednak wynik, trudno uzanć za falowanie.
+
+# [2.250225-1] przem-apply-waves-effect.scm
+* Pierwszy mały sukces
+
+# [2.250225-0] przem-apply-waves-effect.scm
+* Próba skopiowania barwy pixela
+
+# [2.250224-0] przem-apply-waves-effect.scm
+* Nowa propozycja z sincosinus
+
+# [2.250223-3] przem-apply-cents-effect.scm
+* Drobne literówki
+
+# [2.250223-2] przem-apply-cents-effect.scm
+* Dodanie nowego filtra - centkowanie
+
+# [2.250223-0] przem-apply-waves-effect.scm
+* Dodanie nowego filtra
+
+# [2.250222-0] przem-apply-sepia-v3.scm
+* Korekta w SF_OPTION
+
+# [2.250221-0] przem-apply-sepia-v3.scm
+* Dodanie potrójnego pola wyboru dla rodzaju gradientu.
+
+# [2.25021=20-0] przem-apply-sepia-v3.scm
+* Przeniesienie 'gimp-layer-new' do wewnątrz skryptu - desaturate dalej zwraca błąd przy zdjęciach monochromatycznych
+
+# [2.250219-1] przem-apply-sepia-v3.scm
+* Dodanie 'gimp-image-flatten', bez efektu
+
+# [2.250219-0] przem-apply-sepia-v3.scm
+* Dodanie suwaka z shadow-sepia użytego jako argument 'gimp-drawable-edit-gradient-fill'
+
+# [2.250217-0] przem-traditional-photo.scm && przem-traditional-photo-v3.scm
+* Zmniejszyłem skrajne parametry do -100 i 100 dla skali kontrastu i balansu koloru
+
+# [2.250216-3] przem-traditional-photo-v3.scm
+* Dodanie krosowania. Jednak można odnieść wrażenie że zmiana balans koloru nie daje żądnego efektu
+
+# [2.250216-2] przem-traditional-photo-v3.scm
+* Rezygnacja ze suwaka kontrastu na rzecz zmiennej ( -0.15625 )- możliwe że wersja dla 2.10 wykrzącza się przez zbyt wysoki argument dla kontrastu
+
+# [2.250216-1] przem-traditional-photo.scm
+* Kosmetyka danych suwaka
+
+# [2.250216-0] przem-traditional-photo.scm
+* Dodanie suwaka ze zmianą kontrastu oraz suwaka z balansem koloru
+
+# [2.250215-2] przem-traditional-photo.scm
+* dodanie nowego skryptu korsującego zdjęcie
+
+# [2.250215-1] przem-apply-sepia.scm - przem-add-background-under-text.scm
+* Oba skrypty pracują nieprawidłowo z obrazem w odcieniach szarości
+
+# [2.250215-0] przem-apply-sepia.scm
+* BUG ? Nie potrafi przekonwertować obrazka GRAY na RGB - w przypadku szarego obrazu nakłąda jedynie gradient, bez sepii
+
+# [1.250214-0] przem-apply-sepia.scm
+* Częściowe dostosowanie wtyczki do nowego API z RC2 - póki co przetwarza jedynie kolorowe obrazy
+
+# [1.250213-0] przem-apply-sepia.scm
+* Dodałem lepszy gradient, revers gradientu oraz kształt okręgu
+
+# [1.250212-0] przem-apply-sepia.scm
+* Opruje już jedynie na dwóch odcieniach sepii
+
+# [1.250212-0] przem-add-background-under-text.scm
+* Możliwość zmiany koloru tła i czcionki wewnątrz wtyczki, nie można zmienić czcionki. Potrafi się wykrzaczyć
+
+# [1.250910-0~alpha]
+* Wersja alpha 'przem-add-background-under-text.scm', pokazuje samo tło i w dodatku w złym miejscu
+
+# [1.250910-2]
+* Wersja stabilna 'przem-apply-sepia.scm' dla 3.0
+
+# [1.250209-1]
+* Wersja stabilna 'przem-add-background-under-text.scm' dla 2.10
+
+# [0.250207-0]
+* Incjacja skryptu 'przem-apply-sepia.scm'
+
+# [0.250206-0]
+* Incjacja skryptu 'przem-add-background-under-text.scm'
|