GIMP Chat http://gimpchat.com/ |
|
GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugin http://gimpchat.com/viewtopic.php?f=9&t=20652 |
Page 4 of 5 |
Author: | contrast_ [ Tue Dec 12, 2023 4:56 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
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 [ 1.09 MiB | Viewed 44873 times ] Attachment: AI_effects_2.png [ 1.04 MiB | Viewed 44873 times ] |
Author: | contrast_ [ Tue Dec 12, 2023 8:06 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
Download for the GEGL Effects update with Bash to call AI is here. But it is Linux only and doesn't work on Flatpak Attachment: Location to put binaries (there's a lot of them) Code: Select all /home/(USERNAME)/.local/share/gegl-0.4/plug-ins Then Restart Gimp go to GEGL Operations and look for GEGL Effects Continual Edition. Remember, GEGL Effects is both an image outline tool and a text styling engine but in the case of this I am using it for image outlining. If you already have these binaries overwrite all of them with the latest version. Remember you need to have the AI installed and remember to check and uncheck the bash checkbox to run the bash command. Attachment: GEGL_Effects_AI_ready.png [ 1.06 MiB | Viewed 18256 times ] Don't bother compiling on windows it won't work there. we tried. |
Author: | mackenzieh [ Tue Dec 12, 2023 8:10 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
When will a windows version be available? |
Author: | contrast_ [ Tue Dec 12, 2023 8:30 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
This only took a few seconds. Attachment: split_view_effects.png [ 636.26 KiB | Viewed 18254 times ] Attachment: AI_power_gegl_effects.png [ 511.1 KiB | Viewed 18254 times ] and it can save and apply the same setting on anything else. But it looks like in this case the inner glow is to expansive on the turtle, so users will have to change the original setting. Attachment: preset_gegl.png [ 686.5 KiB | Viewed 18254 times ] |
Author: | contrast_ [ Tue Dec 12, 2023 8:31 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
mackenzieh wrote: When will a windows version be available? If I get a professional to help me call Windows PowerShell. I don't know how to do this, but I guess Liam could try. I am sorry and understand that you want this on Windows. |
Author: | contrast_ [ Wed Dec 13, 2023 1:03 am ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
The plan now is to get a Windows version using Windows SubSystem for Linux instead of powershell as that can use bash. |
Author: | contrast_ [ Wed Dec 13, 2023 6:33 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
This should be obvious to point out that commands that work on one image. Attachment: funs.png [ 896.81 KiB | Viewed 18209 times ] Attachment: final_love.png [ 405.08 KiB | Viewed 18209 times ] Do not always turn out proper on another image. Attachment: bash_turtle.png [ 952.51 KiB | Viewed 18209 times ] Lastly, every time a GEGL preset is made the user still has to manually check and uncheck the bash checkbox in tab 9 and we already discussed way earlier in this thread how it loads the previous image file. |
Author: | contrast_ [ Sat Dec 16, 2023 2:42 am ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
This is now on Github. The same download on Github is also on GimpChat https://github.com/LinuxBeaver/AI_in_Gi ... /tree/main |
Author: | contrast_ [ Sat Dec 30, 2023 5:32 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
This bash plugin was not working for a lot of people because the REMBG command changed recently or at least in the past year. months. Here is a list of both rembg commands. Latest REMBG is Code: Select all rembg i /tmp/in.png /tmp/out.png 2022 REMBG is Code: Select all rembg /tmp/in.png -o /tmp/out.png The bash plugin both stand alone and GEGL Effects version updated today. To contain the newest line of code for REMBG in default. This does not count as a new version release. |
Author: | contrast_ [ Sun Dec 31, 2023 4:34 am ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
We got the plugin working on Flatpak Linux ![]() It requires a special build of the source code linked here that you must manually edit and compile, as well as a package called flatpak-spawn (that you don't need to compile). This code now also contains the GEGL Effects bash build added mid day (dec 31st 2023) Attachment: If you want Flatpak bash to work for you have to compile and replace "/home/contrast/tmp/" with your username and directory of choice. This is only for flatpak. Non flatpak users don't have to do this. The reason why is because flatpak can't use the /tmp/ directory. First install flatpak-spawn Code: Select all sudo dnf install flatpak-spawn Code: Select all sudo apt install flatpak-spawn Then download this code and open bash-buddy.c and gegleffectspending.c then replace /home/contrast/tmp/in.png and /home/contrast/tmp/out.png with whatever directory in your own home you like such as this example. /home/john/eggs/in.png /home/john/eggs/out.png Image shows this "search and replace" process. Attachment: this_is_the_way_to_do_it.png [ 4.94 KiB | Viewed 14574 times ] then compile by running build_linux.sh and put the file in /home/(USERNAME)/.var/app/org.gimp.GIMP/data/gegl-0.4/plug-ins and restart Gimp and go to GEGL operations. then if that is the case a command like Code: Select all flatpak-spawn --host rembg i /home/john/eggs/in.png /home/john/eggs/out.png Lastly if you only want the bash AI plugin without GEGL Effects. Ignore all binaries but bash-buddy and spawn if you want GEGL Effects make use of all the binaries. |
Author: | racer-x [ Sun Dec 31, 2023 6:11 am ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
contrast_ wrote: This bash plugin was not working for a lot of people because the REMBG command changed recently or at least in the past year. months. Here is a list of both rembg commands. Latest REMBG is Code: Select all rembg i /tmp/in.png /tmp/out.png 2022 REMBG is Code: Select all rembg /tmp/in.png -o /tmp/out.png The bash plugin both stand alone and GEGL Effects version updated today. To contain the newest line of code for REMBG in default. This does not count as a new version release. It works here with: Code: Select all rembg i /tmp/in.png /tmp/out.png It is extremely slow and had to wait a long time to notice it was working. At least this is a third option. Using command line or JamesH plugin is at least 50 times faster. JamesH also includes Layer Mask to help fine tune. Thanks for this tool contrast. |
Author: | contrast_ [ Sun Dec 31, 2023 2:41 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
racer-x wrote: contrast_ wrote: This bash plugin was not working for a lot of people because the REMBG command changed recently or at least in the past year. months. Here is a list of both rembg commands. Latest REMBG is Code: Select all rembg i /tmp/in.png /tmp/out.png 2022 REMBG is Code: Select all rembg /tmp/in.png -o /tmp/out.png The bash plugin both stand alone and GEGL Effects version updated today. To contain the newest line of code for REMBG in default. This does not count as a new version release. It works here with: Code: Select all rembg i /tmp/in.png /tmp/out.png It is extremely slow and had to wait a long time to notice it was working. At least this is a third option. Using command line or JamesH plugin is at least 50 times faster. JamesH also includes Layer Mask to help fine tune. Thanks for this tool contrast. I put this here earlier this month. Attachment: checkbox_disclaimer.png [ 19.16 KiB | Viewed 12288 times ] I made it clear how to solve this problem earlier in this thread. The slow wait is mandatory in Liam's boy:spawn but my additional plugin lb:bash solves that problem with a checkbox. The checkbox is meant to be pressed on and off after typing a bash command. This is so it would not be extremely slow. Enabling the checkbox runs the bash command and disabling it cancels it. The reason things are so slow is because GEGL is literally rerunning REMBG dozens of times. We don't know how to stop this outside of the checkbox. I tested on multiple machines in Gimp, and they all have the same problem with going extremely slow without the checkbox, but the checkbox flicking on and off it only takes a few seconds to run REMBG. On my machine if I check and uncheck the box it will take a few seconds. If I don't it will take a few minutes. |
Author: | contrast_ [ Thu Jan 04, 2024 7:27 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
This code is partially unique to my system but it uses generic bash commands to call GMIC and the systems GEGL. So what I will do is remove all commands unique to my system and list universal commands. Requires packages gegl and gmic (sudo apt install gegl gmic) Attachment: flatpak_bash_block_text.png [ 403.22 KiB | Viewed 11271 times ] Command for Bash Box Code: Select all gegl -i /tmp/in.png -o /tmp/outgegl.png -- gegl:gegl string=" color-overlay value=#ff0000 crop " && sleep 0.5 && gmic /tmp/outgegl.png output /tmp/outgegl.webp && gmic /tmp/outgegl.webp fx_blocks3d 128,0,6.86,1.5,0,10.08,45,50.1818,54.9091,0,-50,-100,0.5,0.7,1,1,0,0,0,128 -o /tmp/out.png Command for GEGL Box Code: Select all src aux=[ layer src=/tmp/out.png ] Attachment: green_ver_of_3d_blocks.png [ 335.03 KiB | Viewed 11271 times ] Attachment: pasted_image100.png [ 1012.87 KiB | Viewed 11271 times ] |
Author: | contrast_ [ Fri Jan 05, 2024 2:46 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
I just edited every posted messages bash code to list the modern REMBG and not the early 2022 version. It was my fault for using an outdated version of REMBG. |
Author: | contrast_ [ Mon Jan 08, 2024 4:17 am ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
Here is the bash plugin calling GMIC's voronoi filter, then I run a chain of GEGL filters using GEGL syntax. The GEGL filters are color to alpha running twice to remove white then black, emboss by overlay, levels for lighting, sharpen and two drop shadows. Many GEGL filters were used. This effect shows GMIC and GEGL working together. Attachment: voronoi_gmic.png [ 796.9 KiB | Viewed 10598 times ] Attachment: pasted_image120.png [ 823.13 KiB | Viewed 10598 times ] |
Author: | contrast_ [ Mon Jan 08, 2024 12:40 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
Attachment: pasted_image122.png [ 746.17 KiB | Viewed 10502 times ] For some reason the text is always red in default even if the original color is something else. So I used GEGL Hue Chroma in the graph to rotate colors and make it green. I also added a third drop shadow. This was all automated |
Author: | contrast_ [ Tue Jan 16, 2024 4:17 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
Here is an example of practical use of my bash plugin calling GMIC's JPEG SMOOTH then GFPGAN to restore someone's old photo. Attachment: AI_FACE_FUN.png [ 264.8 KiB | Viewed 10179 times ] I also used sharpening and eye lighting manually in Gimp. Original Attachment: original.png [ 159.54 KiB | Viewed 10179 times ] Final Attachment: final.png [ 190.32 KiB | Viewed 10179 times ] Bash Box command (unique to my system) Code: Select all flatpak-spawn --host bash -c ' GEGL Box command NA This took a few seconds and I saved the preset so I can rerun this face restoration command on any image that has faces. The Gimp community needs to study GEGL, I shouldn't be the only one doing this. |
Author: | contrast_ [ Tue Jan 16, 2024 7:08 pm ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
These commands are unique to my system meaning you have to replace all my local directories with your own directory for this to work. But I'll post them anyway just so people can study it. (if they care about GEGL) Its literally just bash on my machine calling AI and GMIC. I am doing the same thing as the post above calling GMIC's JPEG Smooth and GFPGAN in GEGL bash, but this time the difference is that I will be using the GEGL Box below to call the image file with JPEG Smooth (Without Face restoration) to be on 35% opacity to make GFPGAN look less "hyper real". "Hyper Real" is a term where GFPGAN restores a face's quality so good that it looks out of place. The 35% normal layer mode blend with the "GMIC Jpeg Smooth layer" is to reduce the quality of GFPGAN. This is like stacking two normal layers on top of each other with one layer at 35% opacity. Command for Bash Box (highly unique to my system) Code: Select all flatpak-spawn --host bash -c ' Command for GEGL Box (requires swapping DIRNAMES) Code: Select all id=1 gimp:layer-mode layer-mode=normal opacity=0.35 aux=[ ref=1 layer src=/home/contrast/tmp/out2.png ] The saturation at the end is not needed. I just put it there because I wanted a mild saturation boost. If you make the opacity 0.50, the GFPGAN layer will be half transparent. If it is at 1, it will be entirely replaced by the JPEG Smooth layer. This is the final output when GFPGAN's effect is 35% reduced Attachment: new_discovery_GFPGAN.png [ 287.02 KiB | Viewed 10174 times ] This is the final output when GFPGAN's effect is 100% reduced (hidden by the JPEG smooth image) Attachment: hidden_opacity_100.png [ 253.9 KiB | Viewed 10174 times ] These are the files GEGL created while running the bash command. Attachment: files_gegl_is_interacting_with.png [ 271.24 KiB | Viewed 10174 times ] Info about the folder and files: Flatpak Gimp cannot use /tmp/ or /var/tmp/ so I made a bogus /home/username/tmp/ Many GMIC filters "glitch out" on png so I use GMIC to convert the file to webp before I run a GMIC filter then, while running the GMIC filter it is instructed to covert the output of the filter back to .png. As seen here. Code: Select all gmic /home/contrast/tmp/in.png output /home/contrast/tmp/out3.webp && gmic -i /home/contrast/tmp/out3.webp gcd_jpeg_smooth 1,1,0,0 -o /home/contrast/tmp/out2.png I am fully aware that it is sloppy how I am naming files out2, out3. I just put a number in front of it for convenience. This stuff I am doing with GEGL is very advance and I hope others reach this point one day. |
Author: | contrast_ [ Sun Feb 18, 2024 10:00 am ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
*POST EDITED TO CORRESPOND TO CMYK STUDENT'S CORRECTION GEGL converts RGBA to CMYK by calling Image Magick (Linux only) This is a short guide on RGB to CMYK conversions in my GEGL bash plugin. Image Magick does all the work but GEGL exports the png on canvas. This assumes you have Image Magick and my plugin GEGL bash installed. If not install them below. https://imagemagick.org/script/command-line-options.php https://github.com/LinuxBeaver/AI_in_Gi ... h/releases 1. Download this and save it somewhere you'll rememeber https://github.com/ImageMagick/ImageMag ... g/cmyk.icm 2. Find the image you want to convert to CMYK preview and save it as an .icc file in Gimp using "save color profile to file" ![]() ![]() after doing it once you have the option to never do it again, but it may slighly impact the quaility of the CMYK convert. Doing it each time guarantees maximum image quality from what I understand. 3. Code to convert exported layer png in Gimp to CMYK requires changing dirname to wherever you saved the .icm files. Bash Box Code: Select all convert /tmp/in.png +profile icm \ GEGL Box To Import the tiff file Code: Select all src aux=[ layer src=/tmp/out.tiff ] Attachment: cmyk_rgb_convert_for_real.png [ 804.87 KiB | Viewed 9369 times ] If this could be ran like an adjustment layer in "Display Filters" everywhere on canvas we could get a cheap CMYK conversion. Hopefully I or someone else figures out a way to auto grab the icc information from an RGB file. So it doesn't have to be done manually each time for max quality. I hope this RGB to CMYK conversion in GEGL bash is useful to someone's workflow. Remember the second step might only have to be done once. |
Author: | CmykStudent [ Sun Feb 18, 2024 10:04 am ] |
Post subject: | Re: GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugi |
contrast_: Cool! As a heads-up, PNG doesn't support CMYK (the CMYK colors would be treated as RGB on export). You would need to export as a TIFF or JPEG if you want the exported file to be treated as CMYK by other programs. |
Page 4 of 5 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |