GIMP脚本在终端中运行时可以找到自定义调色板,而在程序内部时则找不到

萤火虫

我想gimp -if --batch-interpreter python-fu-eval -b 'import sys;sys.path=["."]+sys.path;import colorindex;colorindex.python_colorindex("gimptemp.jpg")' -b 'pdb.gimp_quit(1)'从像这样的脚本内部执行(在终端中运行时效果很好)colorindex = subprocess.run(["/usr/bin/gimp", "-if", "--batch-interpreter", "python-fu-eval", "-b", "import sys;sys.path=['.']+sys.path;import colorindex;colorindex.python_colorindex('gimptemp.jpg')", "-b", "pdb.gimp_quit(1)"])(错误使gimp函数找不到所需的调色板)

错误:

GIMP-Error: Calling error for procedure 'gimp-image-convert-indexed':
Palette 'E-Ink' not found

Traceback (most recent call last):
  File "/usr/lib/gimp/2.0/python/gimpfu.py", line 827, in _run
    return apply(func, params[1:])
  File "/usr/lib/gimp/2.0/plug-ins/python-eval/python-eval.py", line 25, in code_eval
    exec code in globals()
  File "<string>", line 1, in <module>
  File "./colorindex.py", line 7, in python_colorindex
    pdb.gimp_image_convert_indexed(image, 1, 4, 3, FALSE, FALSE, "E-Ink")
RuntimeError: Palette 'E-Ink' not found
batch command experienced an execution error
/usr/bin/gimp: GEGL-WARNING: (gegl-tile-handler-cache.c:977):gegl_tile_cache_destroy: runtime check failed: (g_queue_is_empty (&cache_queue))
EEEEeEeek! 2 GeglBuffers leaked

当我不小心留了-d标志阻止画笔和东西加载时,在终端中出现了相同的问题,但是显然我把它拿掉了,所以idk这次可能阻止调色板加载,尤其是当它在终端中工作时。使用subprocess.Popen并没有改变错误。通过脚本打开gimp时,自定义调色板不会显示在调色板托盘gui中,但是当通过终端运行时,它确实会显示在gui中

这是colorindex.py

import os
from gimpfu import *
def python_colorindex(file):
    image = pdb.gimp_file_load(file, file, run_mode=RUN_NONINTERACTIVE)
    drawable = pdb.gimp_image_get_active_layer(image)
    pdb.gimp_image_convert_indexed(image, 1, 4, 3, FALSE, FALSE, "E-Ink")
    pdb.file_png_save(image, drawable, file, file, 0, 0, 0, 0, 0, 0, 0)
    pdb.gimp_image_delete(image)
    print("Exit")
Paynekj

我无法复制此文件,因为我是Windows用户,但是我假设您的E-Ink.gpl调色板保存在您的个人调色板目录中,也许运行gimp作为python的子进程不会加载您的个人文件。

您可以通过使用--gimprc = filename选项指向您的个人gimprc文件,尝试强制gimp使用您的个人设置。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

用自定义调色板调用gimp_image_convert_indexed,找不到调色板

来自分类Dev

Seaborn的自定义调色板

来自分类Dev

在camunda modeler中为自定义调色板添加自定义图标

来自分类Dev

为Julia集生成自定义调色板

来自分类Dev

在R中定义自定义颜色调色板

来自分类Dev

加入2个PNG时,ImageMagick保留自定义调色板

来自分类Dev

创建 vscode 主题时如何自定义命令调色板颜色和键绑定

来自分类Dev

在Seaborn中设置自定义调色板的Alpha值

来自分类Dev

Visual Studio颜色属性编辑器中的自定义调色板

来自分类Dev

如何在R中为ggplot自定义调色板?

来自分类Dev

如何在AnyLogic中创建自定义调色板

来自分类Dev

自定义 seaborn 调色板中的颜色不一致

来自分类Dev

从 cronjob 运行时,Python 找不到自定义安装的模块

来自分类Dev

我可以从Windows 10(UWP)应用程序中的Web Worker调用自定义运行时组件吗

来自分类Dev

如何同时使用ColorBrewer调色板将我的自定义图例顺序保留在R中?

来自分类Dev

在 docker bash 脚本中运行时找不到命令

来自分类Dev

“找不到资源“ themes.xxx.xaml””运行时错误-另一个程序集中的WPF自定义组件

来自分类Dev

可以在运行时自定义FilterProvider吗?

来自分类Dev

使用sudo运行自定义脚本-找不到命令

来自分类Dev

将自定义调色板添加到XCode Interface Builder

来自分类Dev

ffmpeg视频转为带有自定义调色板的gif

来自分类Dev

自定义调色板,从colorspace :: choose_palette()向导中提取函数

来自分类Dev

在具有多个调色板的条形图中创建自定义图例

来自分类Dev

如何创建由scale_fill_manual()使用的自定义调色板

来自分类Dev

检测到其他地方的点击,然后从自定义调色板点击按钮

来自分类Dev

饼图自定义调色板百分比

来自分类Dev

是否可以在运行时在Spring Boot中构建自定义查询?

来自分类Dev

我可以在运行时在Ormlite中构建自定义查询吗?

来自分类Dev

是否可以在运行时在Spring Boot中构建自定义查询?

Related 相关文章

  1. 1

    用自定义调色板调用gimp_image_convert_indexed,找不到调色板

  2. 2

    Seaborn的自定义调色板

  3. 3

    在camunda modeler中为自定义调色板添加自定义图标

  4. 4

    为Julia集生成自定义调色板

  5. 5

    在R中定义自定义颜色调色板

  6. 6

    加入2个PNG时,ImageMagick保留自定义调色板

  7. 7

    创建 vscode 主题时如何自定义命令调色板颜色和键绑定

  8. 8

    在Seaborn中设置自定义调色板的Alpha值

  9. 9

    Visual Studio颜色属性编辑器中的自定义调色板

  10. 10

    如何在R中为ggplot自定义调色板?

  11. 11

    如何在AnyLogic中创建自定义调色板

  12. 12

    自定义 seaborn 调色板中的颜色不一致

  13. 13

    从 cronjob 运行时,Python 找不到自定义安装的模块

  14. 14

    我可以从Windows 10(UWP)应用程序中的Web Worker调用自定义运行时组件吗

  15. 15

    如何同时使用ColorBrewer调色板将我的自定义图例顺序保留在R中?

  16. 16

    在 docker bash 脚本中运行时找不到命令

  17. 17

    “找不到资源“ themes.xxx.xaml””运行时错误-另一个程序集中的WPF自定义组件

  18. 18

    可以在运行时自定义FilterProvider吗?

  19. 19

    使用sudo运行自定义脚本-找不到命令

  20. 20

    将自定义调色板添加到XCode Interface Builder

  21. 21

    ffmpeg视频转为带有自定义调色板的gif

  22. 22

    自定义调色板,从colorspace :: choose_palette()向导中提取函数

  23. 23

    在具有多个调色板的条形图中创建自定义图例

  24. 24

    如何创建由scale_fill_manual()使用的自定义调色板

  25. 25

    检测到其他地方的点击,然后从自定义调色板点击按钮

  26. 26

    饼图自定义调色板百分比

  27. 27

    是否可以在运行时在Spring Boot中构建自定义查询?

  28. 28

    我可以在运行时在Ormlite中构建自定义查询吗?

  29. 29

    是否可以在运行时在Spring Boot中构建自定义查询?

热门标签

归档