在 Linux 上安装 GIMP 插件,一般分几种情况:系统仓库插件、手动脚本/插件文件、Python 插件、编译型插件。下面按常见方式给你讲清楚。
很多 GIMP 插件在发行版仓库里就有。
sudo apt update
sudo apt install gimp-plugin-registry
包含很多常用插件(如 wavelet denoise、resynthesizer 等)
sudo dnf install gimp-plugins
sudo pacman -S gimp-plugin-registry
安装后重启 GIMP即可在菜单中看到。
GIMP 插件目录有两个位置:
~/.config/GIMP/2.10/plug-ins/
(GIMP 2.10 为例,版本不同路径略有变化)
/usr/lib/gimp/2.0/plug-ins/
假设插件叫 my_plugin.py 或 my_plugin
mkdir -p ~/.config/GIMP/2.10/plug-ins/my_plugin
cp my_plugin.py ~/.config/GIMP/2.10/plug-ins/my_plugin/
chmod +x ~/.config/GIMP/2.10/plug-ins/my_plugin/my_plugin.py
然后:
#!/usr/bin/env python
#!/usr/bin/env python
from gimpfu import *
def hello_world(img, drawable):
pdb.gimp_message("Hello from plugin!")
register(
"python-fu-hello",
"Hello",
"Show hello",
"Author",
"Author",
"2024",
"Hello...",
"*",
[],
[],
hello_world,
menu="<Image>/Filters/Test"
)
main()
保存为:
~/.config/GIMP/2.10/plug-ins/hello.py
chmod +x hello.py
./configure
make
make install
或手动复制生成的二进制到:
~/.config/GIMP/2.10/plug-ins/
chmod +x~/.config/GIMP/3.0/如果你能告诉我:
我可以直接给你精准安装命令。