It is currently Sat Jun 15, 2024 4:08 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 88 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with Liam's bash pl
PostPosted: Sun Dec 10, 2023 2:15 am  (#41) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
EXTREMELY EXCITING NEWS. THIS PLUGIN UPDATED AND NOW LOADS IN A FEW SECONDS OR LESS ON MOST IMAGES IF THE USER CHECKS AND UNCHECKS A CHECKBOX. IT ALSO IS WAY SIMPLER TO USE

ok its official I am now a co-developer of this bash plugin because I made these modifications to Liam's tool.

Here is it loading very quicky because I pressed the checkbox twice, and notice the two entry boxes? One of them is for bash and the other is for GEGL syntax that comes after bash, and the bash only updates if the checkbox is enabled.

Attachment:
funs2.png
funs2.png [ 539.5 KiB | Viewed 51641 times ]


A known inconvenience that is not a bug exist, it loads the previous image in /tmp/out.png. Once the bash string updates it will replace the picture of the young lady with the bird background removed. The previous image still loads and we can't currently solve this.
Attachment:
known_issues.png
known_issues.png [ 597.49 KiB | Viewed 51641 times ]


Applying the same REMBG and GEGL string command on multiple images and 100% automated in a few seconds. REMEMBER TO PRESS THE CHECKBOX TWICE

The GEGL commands load even if the bash string is not active. The bash string is the only one that is disabled until the checkbox is pressed. This will be on my Github soon

https://github.com/LinuxBeaver/

Attachment:
same_and_quick.png
same_and_quick.png [ 890.46 KiB | Viewed 51641 times ]


Last edited by contrast_ on Sun Dec 10, 2023 2:19 am, edited 2 times in total.

Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with Liam's bash pl
PostPosted: Sun Dec 10, 2023 2:17 am  (#42) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
Update here to the December 10th 2023 version (non flatpak Linux only) and this time it is in GEGL operation under the name Bash Plugin

download/file.php?id=70425

Location to put binaries
/home/(USERNAME)/.local/share/gegl-0.4/plug-ins


Last edited by contrast_ on Sun Dec 10, 2023 4:14 am, edited 2 times in total.

Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with Liam's bash pl
PostPosted: Sun Dec 10, 2023 2:43 am  (#43) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
Oh yeah I forgot to mention by default this loads the most likely REMBG directory for most systems. If typing in REMBG in bash works for you then this will instantly call REMBG. Perhaps I can make separate plugins. One for REMBG, one for GFPGAN and one for GMIC but that would be silly as most people here I assume know how to paste bash syntax and of course people use mini conda that is an alt directory. tee hee

Now Remember, this known problem that everyone will have to get use to

Attachment:
prev.png
prev.png [ 1.14 MiB | Viewed 51631 times ]


Attachment:
prev2.png
prev2.png [ 1.16 MiB | Viewed 51631 times ]




BTW readers, if I get professional help and attention for "big Gimp Youtube channels" I will consider porting this to Windows in Power Shell and making an even better GUI.

Make sure to check out my other work and plugins like my layer effects engine ( I am only posting this because I know this thread is getting a lot of views) and I want to point people to my other awesome work in Gimp

https://github.com/LinuxBeaver/GEGL-Eff ... using-GEGL


Image

Attachment:
pasted_image098.png
pasted_image098.png [ 815.93 KiB | Viewed 51631 times ]



Have an awesome day everyone. I care about Gimp so much. :gimp


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string our bash plugin
PostPosted: Sun Dec 10, 2023 3:06 am  (#44) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
Here's System GMIC being called with the update. It is so much easier.


So If you uncheck it to early the filter may glitch, that is an indication you need to wait longer before unchecking. I made that mistake on this early. Smoothing is slow.

Attachment:
so_fun_gegl.png
so_fun_gegl.png [ 724.23 KiB | Viewed 51622 times ]



Here try this command yourself

Box 1 for bash
gmic /tmp/in.png output /tmp/out3.jpg   && gmic -i /tmp/out3.jpg  fx_smooth_anisotropic 10,0.512,1,2.15,8.61,1.6504,80.48,5,0,1,10,0,0,50,50  -o /tmp/out.png


Box 2 for GEGL
bloom strength=9
saturation scale=1.3


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with Liam's bash pl
PostPosted: Sun Dec 10, 2023 3:51 am  (#45) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
GMIC Anistropic smoothing followed by GEGL saturation, cartoon, emboss by overlay and bloom.

1 GMIC filter and 4 GEGL filters chained together.

Attachment:
gmic_and_bash.png
gmic_and_bash.png [ 1.45 MiB | Viewed 51599 times ]


COMMAND FOR BASH BOX
gmic /tmp/in.png output /tmp/out3.jpg   && gmic -i /tmp/out3.jpg  fx_smooth_anisotropic 10,0.512,1,2.15,8.61,1.6504,80.48,5,0,1,10,0,0,50,50  -o /tmp/out.png



COMMAND FOR GEGL BOX
saturation scale=1.6

id=1 gimp:layer-mode layer-mode=normal opacity=0.15 aux=[ ref=1 cartoon ]

id=2 gimp:layer-mode layer-mode=overlay opacity=0.25 aux=[ ref=1 emboss ]

bloom  strength=25


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string our bash plugin
PostPosted: Sun Dec 10, 2023 4:25 am  (#46) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
ok, I just did another mini update bug fix. All downloads are up to date. There is still a unique bug that sometimes occurs and can only be solved by typing

nop (the do nothing command) or any valid gegl syntax in the GEGL box.


Last edited by contrast_ on Mon Dec 11, 2023 4:19 pm, edited 1 time in total.

Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Sun Dec 10, 2023 2:45 pm  (#47) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
I'm calling the system's GEGL in Gimp so I can run GEGL commands before bash. However due to running system GEGL means I have to have the non Gimp GEGL package installed (sudo apt install gegl)


Attachment:
theory_of_smooth_paint.png
theory_of_smooth_paint.png [ 1.27 MiB | Viewed 51290 times ]


Information to give Bash Box

gegl -i /tmp/in.png -o /tmp/outgegl.png -- gegl:gegl string=' gaussian-blur std-dev-x=0.5 std-dev-y=0.5  id=containall src aux=[ ref=containall id=1 posterize levels=10 cubism tile-size=10 id=0 dst-out aux=[ ref=0  component-extract component=alpha levels in-low=0.15  color-to-alpha opacity-threshold=0.4 ] over aux=[ ref=1 opacity value=0.3 ] id=3 overlay srgb=true aux=[ ref=3 emboss opacity value=0.3 ] ] crop ' && gmic /tmp/outgegl.png output /tmp/out3.webp   && gmic -i /tmp/out3.webp fx_smooth_anisotropic 10,0.512,1,2.15,8.61,1.6504,80.48,5,0,1,10,0,0,50,50  -o /tmp/out.png


Information to give GEGL box
unsharp-mask scale=1.1

not much lol. In fact we could have done the entire thing in the bash box.

Also here is another command with bash syntax unique to my system's custom GFPGAN directory so I cannot post a code box of it. GMIC's jpeg smooth GFPGAN, REMBG and GEGL commands to outline and add a background were added.
This only took 7 seconds where as a few days ago it may have took over 5 minutes
Attachment:
amazing_progress_gegl_bash.png
amazing_progress_gegl_bash.png [ 821.85 KiB | Viewed 51290 times ]



So readers just know that it is possible that a Windows version may come soon as we are figuring out how to call PowerShell in this.


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Sun Dec 10, 2023 2:49 pm  (#48) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
If I get someone professional to help me and host a website with REMBG with special exceptions I will attempt to run REMBG in the cloud from GEGL to show that it is possible to do without installing REMBG.

I can't do it myself so I hope a knowledgable participant chimes in.


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Sun Dec 10, 2023 3:56 pm  (#49) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
There is already this site.... https://www.remove.bg/


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Sun Dec 10, 2023 5:17 pm  (#50) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
I know but that website doesn't run through a cli via bash


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Sun Dec 10, 2023 9:20 pm  (#51) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
I wrote new syntax that blurs the background after running REMBG.

It requires these two plugins of mine to work ideally. This only takes a few seconds on my machine.

https://github.com/LinuxBeaver/Threshol ... /releases/
https://github.com/LinuxBeaver/Gimp-Plu ... -/releases
(chrome text ships with edge smooth that it requires)

Attachment:
rembg_and_bg_blur.png
rembg_and_bg_blur.png [ 910.26 KiB | Viewed 41907 times ]


Attachment:
amazing_gegl_fun.png
amazing_gegl_fun.png [ 757.53 KiB | Viewed 41907 times ]



Bash Code

rembg i /tmp/in.png /tmp/out.png



GEGL Code

      id=all
src aux=[ ref=all

lb:threshold-alpha alphadegree=1
id=1 gimp:layer-mode layer-mode=normal opacity=0.7 aux=[ ref=1]

lb:edgesmooth alpha-percentile2=80

id=2 dst aux=[ ref=2 id=erase ]

id=3 dst-over aux=[ layer src=/tmp/in.png xor aux=[ ref=erase ] id=background_gap ]

xor aux=[ layer src=/tmp/out.png ]



gaussian-blur std-dev-x=30 std-dev-y=30

crop
median-blur radius=10 alpha-percentile=100
gimp:threshold-alpha value=0.4 lb:edgesmooth

bloom strength=9
]


over aux=[ layer src=/tmp/out.png
lb:threshold-alpha alphadegree=1 id=rembgremove gimp:layer-mode layer-mode=normal opacity=0.5 aux=[ ref=rembgremove] lb:edgesmooth alpha-percentile2=80
dropshadow grow-radius=10 radius=14 x=33 opacity value=1 ]



Last edited by contrast_ on Fri Jan 05, 2024 2:42 pm, edited 2 times in total.

Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Sun Dec 10, 2023 9:30 pm  (#52) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
Stat regarding a hopeful Windows version


I tested this plugin on Windows and it appears to by default trying to communicate with cmd.exe and not powershell. cmd.exe was rapidly opening and closing. When I typed in powershell --command it froze Gimp indefinitely and an error window popped up about reporting it. We are going to see if we can get a separate Windows version of this plug-in now that we know it at least tries to talk to Windows.

This will be the first GEGL plugin of mine that has two special versions for both Windows and Linux. In every other case what works on Windows works on Linux.


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Mon Dec 11, 2023 2:08 am  (#53) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
This instructs GEGL to remove a background with REMBG and fix rembg erosion, then blend the fish with the hard light blend mode on saturation followed up by a blue outline.

This requires these two plugins to work

https://github.com/LinuxBeaver/Threshol ... n/releases
https://github.com/LinuxBeaver/GEGL---C ... r/releases


Attachment:
fish_select.png
fish_select.png [ 483.92 KiB | Viewed 41799 times ]


Bash Command
rembg i /tmp/in.png /tmp/out.png


GEGL Syntax (requires two of my plugins)

lb:threshold-alpha alphadegree=1 id=rembgremove gimp:layer-mode layer-mode=normal opacity=0.5 aux=[ ref=rembgremove] lb:edgesmooth alpha-percentile2=80 ]
saturation scale=1.4
id=2 hard-light aux=[  ref=2 opacity value=0.4 saturation scale=1.6 ]
hue-chroma lightness=1
dropshadow x=0 y=0 radius=0 opacity=2 grow-radius=4  color=#00f4ff
median-blur radius=0
dropshadow x=9 y=0 opacity=0.9


Last edited by contrast_ on Fri Jan 05, 2024 2:43 pm, edited 1 time in total.

Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Mon Dec 11, 2023 4:08 pm  (#54) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
REAL ESRGAN AND IMAGE MAGICK CALLED FROM BASH IN GEGL
Image Magick was called to scale down RealESRGAN 4x to 25% of its original size
so it would fit the original image in Gimp's canvas. I used Lancoz interpolation which is the best Image Magick has.


Attachment:
real_esrgan.png
real_esrgan.png [ 351.41 KiB | Viewed 41745 times ]



The original string only works on my computer but I made a modified version that may work on other machines that have REALESRGAN and ImageMagick installed in generic directories.

Bash Command

realesrgan-ncnn-vulkan -i /tmp/in.png -o /tmp/out3.webp -n realesrgan-x4plus s= 2 && magick /tmp/out3.webp  -filter Lanczos -resize 25% /tmp/out4.webp && gmic /tmp/out4.webp output /tmp/out.png


GEGL Syntax
NA - this stays empty unless you want to put something

I also tested running REALESRGAN, GFPGAN and REMBG at at once and it worked but took over 25 seconds. It probably would have took 30 minutes a few days ago before the update.


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Mon Dec 11, 2023 5:19 pm  (#55) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
Here's GEGL calling an image magick filter followed by GEGL's Sharpen. This loads instantly because it is just a simple lighting filter


Attachment:
image_magick_instant.png
image_magick_instant.png [ 580.73 KiB | Viewed 41738 times ]


Bash Command
magick /tmp/in.png +level-colors red, /tmp/out.png


GEGL Command
  unsharp-mask scale=2



Learn how to write image magick syntax here
https://imagemagick.org/script/command-line-options.php

Learn how to write GEGL syntax here
gegl.org/


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Mon Dec 11, 2023 7:58 pm  (#56) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
UPDATE, THIS CODE REQUIRES GEGL'S BLENDING OPTION TO BE SET TO NORMAL, as opposed to the default replace.


Here is an example of me using the system's GEGL + REMBG then Gimp's GEGL to recolor an object inside the image.

The car goes from Yellow to Aqua Blue.

Attachment:
recolor_car_aqua_blue.png
recolor_car_aqua_blue.png [ 898.69 KiB | Viewed 41726 times ]


Command for Bash box
gegl i /tmp/in.png /tmp/outgegl.png -- gegl:gegl string=' hue-chroma hue=134 saturation scale=0.8 levels out-high=0.9 unsharp-mask scale=0.8  ' && rembg /tmp/outgegl.png -o /tmp/out.png



Command for GEGL box

lb:threshold-alpha alphadegree=1
id=1 gimp:layer-mode layer-mode=normal opacity=0.2 aux=[ ref=1]


Last edited by contrast_ on Fri Jan 05, 2024 2:45 pm, edited 2 times in total.

Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Mon Dec 11, 2023 9:28 pm  (#57) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
UPDATE, THIS CODE REQUIRES GEGL'S BLENDING OPTION TO BE SET TO NORMAL, as opposed to the default replace.

Recolor an
object study 2. Make the duck blue.

Attachment:
blue_duck.png
blue_duck.png [ 1 MiB | Viewed 41723 times ]



Or saturate and color adjust the duck (more realistic)

Attachment:
duck_saturate.png
duck_saturate.png [ 929.64 KiB | Viewed 41723 times ]



COMMAND FOR BASH BOX


rembg i /tmp/in.png /tmp/out.png


COMMAND FOR GEGL BOX (Requires my plugins chrome and Threshold alpha 2)
lb:threshold-alpha alphadegree=1
id=1 gimp:layer-mode layer-mode=normal opacity=0.2 aux=[ ref=1]
unsharp-mask scale=0.3
saturation scale=1.6
levels out-low=0.004
hue-chroma lightness=1
bloom strength=4


Last edited by contrast_ on Fri Jan 05, 2024 2:45 pm, edited 1 time in total.

Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Tue Dec 12, 2023 7:13 am  (#58) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
REMBG AND BASH BOX IN MY GEGL EFFECTS PLUGIN

I got bash box working in an unreleased version of my layer effects engine. GEGL Effects is applying effects after REMBG, but it can also do any other bash string.


Here is the download to my GEGL Effects layer effects engine that does NOT include this update. But soon it will!
https://github.com/LinuxBeaver/GEGL-Eff ... L/releases



Now that we know GEGL is capable of doing all this, its safe to say Gimp's future is secured.


Attachments:
rembg_gegl_effects.png
rembg_gegl_effects.png [ 561.31 KiB | Viewed 41671 times ]
Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Tue Dec 12, 2023 7:32 am  (#59) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
It is so exciting to see REMBG inside an unreleased version of GEGL Effects! Its amazing how these workflows are being automated.

Attachment:
rembg_in_gegl_effects.png
rembg_in_gegl_effects.png [ 611.98 KiB | Viewed 41669 times ]


Top
 Post subject: Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi
PostPosted: Tue Dec 12, 2023 4:56 pm  (#60) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1437
AI IN GEGL EFFECTS

It is working consistent and stable in GEGL Effects. I will push the GEGL Effects December 12 update soon and now everyone gets to see my special Linux Desktop that looks like Windows XP, lol.

Attachment:
AI_in_gegl_effects.png
AI_in_gegl_effects.png [ 1.09 MiB | Viewed 44843 times ]


Attachment:
AI_effects_2.png
AI_effects_2.png [ 1.04 MiB | Viewed 44843 times ]


Top
Post new topic Reply to topic  [ 88 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Is it possible to make a plugin that runs bash scripts on a clipboard

1

No new posts Please make a python plugin to combine my GEGL filters with GMIC

1

No new posts Attachment(s) Baby's first GEGL plugin - a very basic GEGL plugin anyone can make.

9

No new posts Attachment(s) GEGL Background on top (first public GEGL plugin of 2024)

0

No new posts GEGL plugin that outlines with a bevel and more

0



* Login  



Powered by phpBB3 © phpBB Group