0

I do not understand why my call to pdb.gimp_histogram throws a RuntimeError: execution error.

from gimpfu import *

def plugin_main ( timg, tdrawable ):

    pdb.gimp_histogram( tdrawable, 0, 0, 255 )

According to the docs, the function takes four arguments:

  • drawable ( type drawable)
  • channel to modify ( type int )
  • start range ( type int )
  • end range ( type int)

I provide all four in the barebones code above, so why is the error thrown?

4

1 回答 1

1

代码看起来正确(我有类似的代码)。

但是,如果图像是彩色索引的,我会得到同样的错误,而文档说“绘图可能没有被索引。 ”,所以这可能是你的问题吗?

PS:您应该使用命名常量(HISTOGRAM_{VALUE|RED|BLUE|GREEN|ALPHA}

于 2018-11-28T15:11:32.890 回答