Compare commits

..

34 Commits

Author SHA1 Message Date
maniu ac7a3e7045 Update python-fu-removebg/python-fu-removebg.py
Signed-off-by: maniu <maniu@pm.me>
2025-06-22 16:21:18 +02:00
Marek Pistorius 432886b5e6 Update python-fu-removebg.py 2025-06-03 13:26:21 +02:00
Marek Pistorius 4f580d00f5 Update python-fu-removebg.py
add show_alert
2025-06-03 13:17:01 +02:00
Marek Pistorius a1aa07a38f Update python-fu-removebg.py 2025-05-28 21:08:46 +02:00
Marek Pistorius fd99e8a197 Update python-fu-removebg.py
find path for rembg
2025-05-28 20:35:12 +02:00
Marek Pistorius 2c0c9b2eeb Update python-fu-removebg.py 2025-05-28 19:38:16 +02:00
Marek Pistorius 2258f592ac Update python-fu-removebg.py
fix mask part
2025-05-25 21:50:49 +02:00
Marek Pistorius 06e563af85 Update python-fu-removebg.py 2025-05-25 21:29:08 +02:00
Marek Pistorius 928b26899a Update python-fu-removebg.py 2025-05-25 21:15:08 +02:00
Marek Pistorius b55589dd68 Update python-fu-removebg.py 2025-05-25 21:14:16 +02:00
Marek Pistorius 37706c827d Update python-fu-removebg.py 2025-05-25 20:51:18 +02:00
Marek Pistorius 9b1321fe43 Update python-fu-removebg.py
Rename pchannel_choice to model_choice to more represent of purpose of that variable
2025-04-15 14:24:15 +02:00
Marek Pistorius 545df0a335 Update python-fu-removebg.py 2025-03-12 16:11:27 +01:00
Marek Pistorius 5676b3d7a3 Update README.md 2025-02-27 13:54:39 +01:00
Marek Pistorius ed60f3014d Update README.md 2025-02-27 13:53:08 +01:00
Marek Pistorius a0ddddff6a Update python-fu-removebg.py
Add Copyright Notice
2025-02-03 17:42:38 +01:00
Marek Pistorius a3c38a064b Update python-fu-removebg.py 2024-11-10 13:37:56 +01:00
Marek Pistorius a552f6ec52 Create pull_request_template.md 2024-11-09 16:23:18 +01:00
Marek Pistorius 9dedb560bc Update pull_request_template.md 2024-11-09 16:22:33 +01:00
Marek Pistorius 163005b2a6 Update CONTRIBUTING.md 2024-11-09 16:21:05 +01:00
Marek Pistorius 7603fe689b Create pull_request_template.md 2024-11-09 16:12:56 +01:00
Marek Pistorius 209e8b024f Create SECURITY.md 2024-11-09 16:06:38 +01:00
Marek Pistorius b28e4fb263 Create CONTRIBUTING.md 2024-11-09 16:05:56 +01:00
Marek Pistorius 751b57de57 Create CODE_OF_CONDUCT.md 2024-11-09 16:05:21 +01:00
Marek Pistorius b3d0300f87 Update issue templates 2024-11-09 16:04:01 +01:00
Marek Pistorius 3cc3531acd Create README.md 2024-11-09 16:02:44 +01:00
Marek Pistorius bb0aac7078 Update README.md 2024-11-09 16:01:06 +01:00
Marek Pistorius 5554c96ef6 Rename README to README.md 2024-11-09 16:00:26 +01:00
Marek Pistorius 50b74489fa Update README for python-fu-removebg 2024-11-09 15:59:20 +01:00
Marek Pistorius cdfe70377f Update python-fu-removebg with using subproccess
os.system => subprocess
2024-11-09 15:55:37 +01:00
Marek Pistorius 2997b8f45a Update Python-fu-removebg.py with correct mask 2024-11-08 21:31:18 +01:00
Marek Pistorius a0cd7539e9 Add python-fu-removebg.py
[PYTHON] Add python-fu-removebg.py
2024-11-08 21:07:34 +01:00
Marek Pistorius 2c116f5383 Create README
Create README for python-fu-removebg
2024-11-08 21:05:40 +01:00
Marek Pistorius 3c61f78e0d Initial commit 2024-11-08 21:04:20 +01:00
2 changed files with 0 additions and 107 deletions
-3
View File
@@ -1,4 +1 @@
All scripts belong with same name folder into gimp 3 script folder All scripts belong with same name folder into gimp 3 script folder
for example:
python-fu-removebg belong to same named folder in gimp config folder /Scripts folder
-104
View File
@@ -1,104 +0,0 @@
#!/usr/bin/env python3
import gi
gi.require_version('Gimp', '3.0')
from gi.repository import Gimp
gi.require_version('GimpUi', '3.0')
from gi.repository import GimpUi
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Gio
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pathlib import Path
from typing import Any, Callable, List, Optional, Tuple, Union
import os, sys, string, tempfile, platform
gi.require_version('Gegl', '0.4')
from gi.repository import Gegl
class PythonInstagram1977(Gimp.PlugIn):
## GimpPlugIn virtual methods ##
def do_set_i18n(self, procname):
return True, 'gimp30-python', None
def do_query_procedures(self):
return [ 'Instagram1977' ]
def do_create_procedure(self, name):
procedure = Gimp.ImageProcedure.new(self, name,
Gimp.PDBProcType.PLUGIN,
self.instagram1977, None)
procedure.set_sensitivity_mask(Gimp.ProcedureSensitivityMask.ALWAYS)
procedure.set_image_types("RGB*")
procedure.set_documentation ("Instagram1977",
"Instagram1977",
name)
procedure.set_attribution("M",
"(c) GPL V3.0 or later",
"2026")
procedure.set_menu_label("Instagram1977")
procedure.add_menu_path('<Image>/Filters/')
return procedure
def instagram1977(self, procedure, run_mode, img, drawables, config, run_data ):
Gimp.context_pop()
img.undo_group_start()
lg = Gimp.GroupLayer.new(img)
lg.set_name("1977 Effect")
img.insert_layer(lg,None,-1)
drawCopy = Gimp.Layer.new_from_drawable(drawables[0],img)
img.insert_layer(drawCopy,lg,0)
#adjust curves colors
drawCopy.curves_spline(Gimp.HistogramChannel.ALPHA,(0,60, 65,70, 255,255) )
Gimp.Selection.all(img)
sel_size = Gimp.Selection.bounds(img)
w = sel_size.x2 - sel_size.x1
h = sel_size.y2 - sel_size.y1
l = Gimp.Layer.new(img,"1977Col",w,h,Gimp.ImageType.RGBA_IMAGE,100.0,Gimp.LayerMode.DARKEN_ONLY)
img.insert_layer(l, lg,0)
color = Gegl.Color.new("rgba(227,255,215,0)")
Gimp.context_set_foreground(color)
l.edit_fill(Gimp.FillType.FOREGROUND)
l.set_mode(Gimp.LayerMode.DARKEN_ONLY)
Gimp.Selection.none(img)
#add white border
Wborder = Gimp.Layer.new(img,"whiteBorder",w,h,Gimp.ImageType.RGBA_IMAGE,100.0,Gimp.LayerMode.NORMAL)
img.insert_layer(Wborder, lg, 0)
wcolor = Gegl.Color.new("white")
Gimp.context_set_foreground(wcolor)
img.select_rectangle(0, 0,0, w,h )
dimBorder = int( (w/100)*2 )
if dimBorder<5:
dimBorder=5
Gimp.Selection.shrink(img, dimBorder)
Gimp.Selection.invert(img)
Wborder.edit_fill(Gimp.FillType.FOREGROUND)
Gimp.Selection.none(img)
#add black border
Bborder = Gimp.Layer.new(img,"blackBorder",w,h,Gimp.ImageType.RGBA_IMAGE,100,Gimp.LayerMode.NORMAL)
img.insert_layer(Bborder,lg , 0)
bcolor = Gegl.Color.new("#000000")
Gimp.context_set_foreground(bcolor)
img.select_rectangle( 0, 0,0, w,h )
dimBorder=int( (w/100)*2 )
if dimBorder < 5:
dimBorder = 5
Gimp.Selection.shrink(img, dimBorder)
Gimp.Selection.invert(img)
Bborder.edit_fill(Gimp.FillType.FOREGROUND)
Gimp.Selection.none(img)
img.undo_group_end()
Gimp.displays_flush()
return procedure.new_return_values(Gimp.PDBStatusType.SUCCESS, None)
Gimp.main(PythonInstagram1977.__gtype__, sys.argv)