and have successfully been able to pull up its dialog box but, it doesn't do anything. I've changed the path as the thread suggests and the problem seems to be with actually installing the rembg program that is also required to make the plugin work properly.
There is another user in the same thread having the same issue I am having which was never resolved for him so I thought it would be best to ask the question here about how to actually install the rembg program on Linux Mint 22.1.
I start getting all types of other dependencies that need to be installed, just to actually get started with the install itself, and was wondering if anyone has ever made the plugin work properly in Linux Mint/Ubuntu/etc... before I go to the trouble of trying to install God knows how much stuff to make it work.
Maybe it's a rabbit hole that would be best not to go down?
The Appimage is one that Rich fixed up for me based on Mateusz Lukasik's PPA.
Sorry about this. Disregard this thread and delete if necessary. I've found another way to install this program and it works for me, for 50 free usages a month anyway and that's good enough.
04-18-2025, 12:49 PM (This post was last modified: 04-18-2025, 01:06 PM by saberwarthog.)
For anyone that might be interested by a plugin that is close (but doesn't use Rembg & only works on Linux for now), I found this plugin : Gimp Background Remover
The installation is quite simple (but don't forget to change the name of the folder to have it corresponding to the py file's one as usual !), and you really need to follow their readme, but it does work quite well, I especially like that the plugin create a layer mask for the background removing.
It's not as good as any remove.bg plugin for example, but the fact that it works on the computer directly without needing any network / API key / subscription, and it works even on a Adler Intel N100 proc... Yeah, that could be an interesting option ?
I know that I'll keep it for that kind of work if I need it for now.
(I'm proposing this plugin I found because I got the same problems with almost all of the other removing background plugins I found :
they either work in a way I don't want them to (https://github.com/ismdevteam/gimp3-rembg-plugin for example, it creates a copy of the image without the background & no option to have it as a mask directly on the original image for corrections.
Either of those uses rembg, and the only way I found to be able to make the first one run on Linux was to basically install rembg as a python package into the plugin folder after compiling it on a python ENV else where in my home folder ? I can't remember how I did it right now... Look like there is not much possibility to make it work directly with a rembg installed into a personal python ENV or even one installed globally for now)
(04-18-2025, 12:49 PM)saberwarthog Wrote: For anyone that might be interested by a plugin that is close (but doesn't use Rembg & only works on Linux for now), I found this plugin : Gimp Background Remover
The installation is quite simple
Saberwarthog, that is another plugin from the same author I mentioned in my second post. I'm glad you brought this up and have successfully installed it because I chose not to install it initially and maybe it's not that hard to do if explained. I'd like to ask you a couple of questions.
First of all, what is an LDF folder? Do I create that folder and if so, where do I place it and what do I put in it? Also, what is the deal with the setup.sh file? Do I run that file, if so from where, or place it somewhere after install or what? How does that work?
Having a background remover what worked offline would be preferable to one that requires an Internet connection, runs through a website, and is limited to 50 usages a month.
04-18-2025, 10:50 PM (This post was last modified: 04-18-2025, 10:56 PM by saberwarthog.)
(04-18-2025, 08:25 PM)" CtrlAltDel Wrote:
(04-18-2025, 12:49 PM)saberwarthog Wrote: For anyone that might be interested by a plugin that is close (but doesn't use Rembg & only works on Linux for now), I found this plugin : Gimp Background Remover
The installation is quite simple
Saberwarthog, that is another plugin from the same author I mentioned in my second post. I'm glad you brought this up and have successfully installed it because I chose not to install it initially and maybe it's not that hard to do if explained. I'd like to ask you a couple of questions.
First of all, what is an LDF folder? Do I create that folder and if so, where do I place it and what do I put in it? Also, what is the deal with the setup.sh file? Do I run that file, if so from where, or place it somewhere after install or what? How does that work?
Having a background remover what worked offline would be preferable to one that requires an Internet connection, runs through a website, and is limited to 50 usages a month.
Oh don't worry, the folder in in fact in the Background Remover archive ! (if you clic on the green "<> code" button, there is a "download ZIP" line)
the main folder (that should be renamed "background-remover, from " GIMP-Background-Remover-main") should be organized like this :
background-remover(the folder that has to be put in your "plug-ins" folder of Gimp 3)
|
|- .gitignore
|- background-remover.py (the python script that is the plugin basically)
|- README.md (thereadme file explaining the use of the plugin)
|- setup.sh (a file that had to be executed in a terminal, don't worry it's quite easy)
|
|- Ldf(folder, you put the "weights" here after install)
|
|- dataset.py
|- net.py
|- README.md (another readme)
|- test.py
Once this folder is put inside the "plug-ins" folder of Gimp 3 & renamed correctly, you have to do 2/3 things first :
verify that "background-remover.py" is executable (you should be able to right click on it, and look at its properties, in the "permissions" part, make sure it's allowed to be executed like a program (it should be by default ?))
inside the background-remover folder, you should be able to right clic & "open in a terminal" (it depends of your distribution & your desktop tho)
in that terminal, you type (or copy / paste) the command under here :
Code:
bash ./setup.sh
This command will use the "bash" program to execute the setup.sh inside the folder (this is why there is ./ before setup.sh), and install / compile what is needed to make things work in the plugin (you should see some lines scrolling, python programs being installed, etc...).
After all of this is done, you need the "weights" (basically, the files that had the trainings needed for the background removing to work) to be put in the Ldf folder already installed :
you'll need to download the files pointed by the 2 links : Trained model weights & backbone weights
normally, you will get a "model-40" file (92 Mo) & a "resnet50-19c8e357.pth" file (97,8 Mo), you put both of them inside the Ldf folder.
if everything goes as planned, on the next launch of Gimp you should find the plugin at Filters -> RemoveBackground -> Offline Background Remover
Yesterday, 02:37 AM (This post was last modified: Yesterday, 03:07 AM by CtrlAltDel.)
(04-18-2025, 10:50 PM)saberwarthog Wrote: if everything goes as planned, on the next launch of Gimp you should find the plugin at Filters -> RemoveBackground -> Offline Background Remover
Thanks for the more detailed instructions than the readme file provided, saberwarthog. I downloaded the .zip file, placed the contents of that .zip file in the plugins folder within a new folder named background-remover, made background-remover.py executable and ran setup.sh from a terminal window inside the newly created folder and it created a folder named gimpenv.
After this, I downloaded both model-40 and resnet50-19c8e357.pth and placed them in the Ldf folder, as seen here:
Unfortunately, none of this was successful and there is no entry for background remover under the Filters menu in Gimp 3.0.
Maybe it's because I am using a Gimp AppImage, which sometimes has some issues with certain things. Anyway, it was worth a try and thanks for the help.
The regular and more simple remove_bg_gimp3.py plugin, from the same author, does work with an AppImage, as seen here:
Thinking that this plugin may somehow be interfering with his background-remover.py plugin, I removed it, restarted Gimp, and still got no entry on the Filters menu.
Yesterday, 10:16 AM (This post was last modified: Yesterday, 10:45 AM by saberwarthog.)
Hmmm, maybe my installation do work because I've made a modification before even launching it ?
I wanted it to appear directly at the root of the "filters" menu (to compare it to other remove background plugins like the Rembg ones that were there).
So I modified the line 59 to
Code:
procedure.add_menu_path('<Image>/Filters/')
and I just saw that there is 2 changes from the original : the specific location for the plugin & I used ' instead of "
I've attached my modified version of background-remover to this message, would you like to put it in place of the original & retry it (after verifying it's still executable) ?
I think that it might be a possible solution.
If it works, you should be able to place it anywhere you want by modifying this specific line, adding a name of a submenu just after the last / in '<Image>/Filters/'
(Yesterday, 10:16 AM)saberwarthog Wrote: I've attached my modified version of background-remover to this message, would you like to put it in place of the original & retry it (after verifying it's still executable) ?
I think that it might be a possible solution.
I gave it another try with your .py, saberwarthog, and had the same results. It's just something to do with the AppImage I am using probably. No big deal. Thanks for helping.
Today, 08:11 AM (This post was last modified: Today, 08:19 AM by rich2005.)
I wonder which version of linux is best ? Tried it with kubuntu 24.04 appimages (both small and gimp.org version) + a Gimp 3 from PPA's in Mint 21 and Mint 22.
In a terminal you can get a long error listing but common to the above is a python mis-match
Code:
Please note and check the following:
* The Python version is: Python3.11 from "/tmp/.mount_gimp.oUicEjh/usr/bin/python3"
* The NumPy version is: "2.2.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy._core._multiarray_umath'
Probably more trouble than it is worth with an appimage , with the model files and all the files pulled in running the setup.sh, the plugin ends up 1.3 GB + anything python3-pip pulls in as dependencies (if not already installed)
Edit: I have to say when they do work they can be quite effective, I have one for Gimp 2.10, even larger, 1.7 GB intelligent-select that I (occasionally) run off a USB SSD As far as I can see uses stable-diffusion-horde (whatever that is ?)
(Today, 08:11 AM)rich2005 Wrote: I wonder which version of linux is best ? Tried it with kubuntu 24.04 appimages (both small and gimp.org version) + a Gimp 3 from PPA's in Mint 21 and Mint 22.
In a terminal you can get a long error listing but common to the above is a python mis-match
Code:
Please note and check the following:
* The Python version is: Python3.11 from "/tmp/.mount_gimp.oUicEjh/usr/bin/python3"
* The NumPy version is: "2.2.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy._core._multiarray_umath'
Probably more trouble than it is worth with an appimage , with the model files and all the files pulled in running the setup.sh, the plugin ends up 1.3 GB + anything python3-pip pulls in as dependencies (if not already installed)
Edit: I have to say when they do work they can be quite effective, I have one for Gimp 2.10, even larger, 1.7 GB intelligent-select that I (occasionally) run off a USB SSD As far as I can see uses stable-diffusion-horde (whatever that is ?)
Right, it would be nice to have it but it isn't that great of a loss with the one that does work which runs through the removebg website. I ran a FoxClone image restore after the failures to install just to make sure no important files had their versions altered or anything.
I'm glad you verified it wasn't just a person behind the keyboard error on my end.
The intelligent-select you mentioned for 2.10 seems interesting. Does that work with the 2.10.38 AppImage? That would be great to have and would probably save a lot of time instead of painstakingly selecting intricate parts of an image by free select, paths, etc...
but I didn't try to install it assuming it wouldn't work since his gimp-background-remover plugin didn't work on an AppImage and it also uses a neural network.