Skip to content

GEGL calls bash so users can input bash strings that call anything including AI's. By default GEGL uses /tmp/in.png and /tmp/out.png - (/tmp/in.png) is the exported layer, and the final result to import is (/tmp/out.png). Please note, Bash is a security risk becase someone can run a dangerous command so be careful.

License

Notifications You must be signed in to change notification settings

LinuxBeaver/AI_in_Gimp_by_GEGL_calling_bash

Repository files navigation

A special build of my GEGL Layer Effects engine that uses this plugin internally on its 9th tab "Run a bash command on Linux" can be downloaded here and the same rules apply. This plugin works as both a stand alone and a tool inside a special build of GEGL Effects.

https://github.com/LinuxBeaver/AI_in_Gimp_by_GEGL_calling_bash/blob/main/AI_BASH_GEGL_EFFECTS_Linux_only_binaries_code.zip

Call AI (or anything external) In Gimp using bash plugin

This plugin is literally just a bash terminal and the ability to run the bash command with a checkbox going on and off. If you have AI's installed (like REMBG, GFPGAN, ect... that means you can run the through Gimp in this GEGL plugin then apply more GEGL syntax after ward. All GEGL is doing is grabbing a final output /tmp/out.png afte running a bash string that the user wrote.

It is highly recommended you install these tools with this plugin so you can call them in bash

REMBG https://pypi.org/project/rembg/

GFPGAN https://github.com/TencentARC/GFPGAN/

REALESRGAN https://github.com/xinntao/Real-ESRGAN

GMIC (remember the built in AI's GMIC has they can be used too) https://gmic.eu/

Image Magick https://imagemagick.org/

Images

REMBG + GEGL's Outline ability

image

REMBG, GFPGAN, GMIC and GEGL together

image

GEGL (outside of Gimp) followed by AI background removal and GEGL inside Gimp.

image

I shouldn't have to say this but it looks like Windows XP because of a Linux theme. Moving on...

Quick guide to plugin:

  1. You need the AI/whatever app installed on your machine and check to make sure said AI/whatever app works through bash.

  2. The first command is always the bash string followed by optional GEGL syntax. The only way GEGL commands can come first is if users call the systems gegl outside of Gimp and that technically still is bash.

  3. No matter what the bash string is GEGL is only programmed to export the current layer as "/tmp/in.png" and call the final result "/tmp/out.png" so use those two lines in your bash string for the input and final output.

  4. Box 1 is for bash inputs such as rembg /tmp/in.png -o /tmp/out.png

  5. The checkbox is to run the bash command; after it is ran it should be disabled quickly. Gimp will freeze and unfreeze if done correctly. If it isn't unchecked quickly it will take dozens of times longer to load.

  6. Box 2 is for optional GEGL syntax after a bash command. You don't have to put anything here if you don't write GEGL syntax.

  7. The previous /tmp/out.png image will load (if it exist there) and will only go away if the checkbox is checked/unchecked (to update it) or if the file is manually deleted. Just get use to the previous image loading on start up and know it will go away.

Location to put binaries (they don't go in the normal plugins folder)

Linux

/home/(USERNAME)/.local/share/gegl-0.4/plug-ins

THIS PLUGIN DOES NOT WORK ON WINDOWS OR FLATPAK LINUX AS THAT CAN'T CALL BASH

Then restart Gimp and go to GEGL operation drop down list and look for "Bash Plugin" or "GEGL Effects Continual" and go to the 9th tab named "Run a bash command on Linux"

Compiling and Installing

Click the build all button to compile everything but you can also read here how to compile individual files.

Linux

To compile and install you will need the GEGL header files (libgegl-dev on Debian based distributions or gegl on Arch Linux) and meson (meson on most distributions).

meson setup --buildtype=release build
ninja -C build

If you have an older version of gegl you may need to copy to ~/.local/share/gegl-0.3/plug-ins instead (on Ubuntu 18.04 for example).

BEAVER RECOMMENDS YOU USE A MODERN VERSION OF GEGL. NO GUARANTEE DATED VERSIONS OF GIMP WILL WORK WITH THIS PLUGIN

Windows

This plugin cannot work on Windows because it calls native Linux bash. Windows Sub System for Linux version may come soon but as of now it is not avalible.

Previews of Special GEGL Effects integration via

https://github.com/LinuxBeaver/AI_in_Gimp_by_GEGL_calling_bash/blob/main/AI_BASH_GEGL_EFFECTS_Linux_only_binaries_code.zip

image

image

image

More previews of this based Plugin (in stand alone mode)

image

image

image

image

image

image

About

GEGL calls bash so users can input bash strings that call anything including AI's. By default GEGL uses /tmp/in.png and /tmp/out.png - (/tmp/in.png) is the exported layer, and the final result to import is (/tmp/out.png). Please note, Bash is a security risk becase someone can run a dangerous command so be careful.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published