问题标签 [gimpfu]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
6455 浏览

python - 批量导出 Gimp 中所有打开的窗口

我只是在 gimp 中手动编辑了 200 多个 .PDF 文件,我想一次批量导出所有文件(以 .PDF 格式),而不是一个一个地导出。

我已经plugin-registry安装了,但我不确定在这种情况下是否可以利用它。

我想我需要的是一个脚本/控制台命令,但我对 Python 一无所知。

谢谢你的帮助。

0 投票
1 回答
46 浏览

gimp - 如何为我的插件创建自己的前缀?

当 Gimp 无法安装我的 python 插件时,它会这样说:

凉爽的。但是,如何为自己的插件创建新前缀?甚至有可能吗?

编辑

似乎使用<Image>前缀会使菜单Desarrollo de juegos出现在 Gimp 的菜单上,这是我想要的。那是<Image>前缀的预期行为?

0 投票
2 回答
240 浏览

gimp - Gimp - The current image is not passed as parameter to my plug-in function

I have this function def enumerategrid(image, width, height, tcolor, theight, font, startfrom)

And have it registered:

However, when I want to run the new installed plugin, I get this error from Gimp:

enter image description here

It seems like Gimp is not passing the current image to my plug-in, so 6 arguments are passed instead of 7. How can I solve this issue?

0 投票
2 回答
2443 浏览

python - 使用 Gimp Python 插件导出所有 SVG 路径

我想编写一个 Gimp-Python 插件,以便从当前图像中导出所有 SVG 路径。这看起来很简单,但我被 pdb 调用困住了,我可能没有正确调用程序,所以我需要你的帮助。

这是我的代码:

打开 Gimp 并加载图像后,当我单击我的插件时,我收到此错误:

调用 « gimp-procedural-db-proc-info » 时出错:找不到过程«vectors-export-to-file »

当我在 Gimp PDB 中搜索时,我可以找到“gimp-vectors-export-to-file”,那么问题是什么?我应该如何调用这个程序?

0 投票
0 回答
1515 浏览

gimpfu - 使用 scm 脚本从 gimp 导出所有打开的文件

我想将所有打开的文件从 gimp 导出为 png 格式,但我收到有关文件的错误:未绑定变量:文件名

这是脚本:

0 投票
1 回答
4257 浏览

python - Gimp:如何使用 python 脚本在没有色彩空间信息的情况下将图像导出到 BMP?

我正在为 Gimp 编写一个 python 脚本,以将图像的所有层导出到 BMP。

要导出给定层,我使用以下过程file_bmp_save

但是这个函数将色彩空间信息保存在 BMP 头中。

当我手动导出 BMP ( File > Export) 时,有一个选项

不写色彩空间信息

查看屏幕截图

我想在我的 python 脚本中重现这个选项。

0 投票
1 回答
152 浏览

python - 如何在不退出每个 GIMP 的情况下运行多个连续的 GIMP 批处理命令?

有没有办法从 bash shell 脚本或 python 脚本一个接一个地运行这些 GIMP 批处理命令,而不会在每个之后退出 GIMP?

0 投票
1 回答
72 浏览

python - Where can I select my personal plugins in GIMP?

I have been trying to run these sample scripts (specially helloworld.py and pytemplate.py) to get the hang on using python code in GIMP. I'm specially interested in pytemplate.py which is intended to show how to do something over an existing image (hopefully, the current state of the image which has the focus)

As far as I know, I have to place them in ~/.gimp-2.8/plug-ins/ (in my GIMP's personal folder) and give them run permissions (chmod +x somescript.py).

The gimpfu.register() function has a kwarg that seems to control where the "trigger option" would appear. It looks like:

However, my GIMP has the menus in Spanish language, somehow this makes me being afraid that it can interfere in rendering the "trigger"... Anyway, I restarted GIMP and tried to follow the menu path from my GIMP's main window's menu and didn't find anything at all.

The point is: What else do I have to do to run the script and see what happens? Can I actually control where the "trigger option" to run my script will appear with menu kwarg?

0 投票
2 回答
220 浏览

python - Gimpfu 脚本:为什么图层的 ID 会损坏?

我一直在试验 GIMP(v2.8.10) 层的操作,以编程方式使用自定义 gimpfu 插件。我成功地选择、旋转、缩放和平移现有图层的一部分:

插件内部的部分代码:

为相关性而简化。所有这些说明都有效。

问题

  • 如果我删除最后一行(gimp_layer_translate),其他一切正常。
  • 否则,如果我删除包含的行gimp_layer_scale,其他一切都有效。
  • 但是,如果我尝试将所有这些功能一起使用,则会gimp_layer_translate崩溃RuntimeError

程序 gimp-layer-translate 已被调用,但 «layer» arg 的 ID 不正确。可能正在尝试使用不存在的层进行操作。

我不知道为什么它会这样失败。如果他们单独工作,为什么不一起工作?我想知道。

参考

我过去常常从template.pygimpbook.com开始构建插件,因为它似乎有一个坚实的结构,可以将代码包含在“撤消块”中。我的主要信息来源pdb是我在谷歌上找到的这个网站。另外,我发现了一些我在这个问题上需要的程序。

此外,我之前的一个问题可能有助于作为如何开始为 gimp 制作自定义插件的参考。

是什么让我卡住了

我不确定原因是 gimp 的错误还是我的代码执行错误。由于链接问题的答案上发布了一些代码,我想知道我是否过度使用了可用内存(毕竟,在我发现之前我不知道我必须使用特定的过程调用来销毁对象关于那个答案)。如果我不删除它们会怎样?我想知道。它们会在我关闭 GIMP 之前一直保留在 RAM 中,还是会生成会淹没 GIMP 系统的持久文件?老实说,我不知道忽视这个问题的后果。

0 投票
1 回答
122 浏览

python - Gimp python 插件调试与 Winpdb 麻烦

我想调试一些脚本,我遵循了这篇文章 在 windows 上用 python 编写 gimp 插件的 Omid Raha 建议-我该如何调试?输出在哪里?.

系统工作,所以我可以进入我的代码,但是当执行到达时会发生这个错误

错误是:

(pythonw.exe:3588):LibGimpBase-ERROR**:gimp_wire_write_msg: 有线协议尚未初始化

我放在我的代码文件的开头:

如果我评论这一行并在没有调试器的情况下运行代码,它会正确运行。

谢谢

马可