GIMP python-fu 调用函数plug_in_beautify 'wrong number of parameters'
GIMP python-fu call function plug_in_beautify 'wrong number of parameters'
我尝试在 python 命令行中使用很棒的 Beautify 插件,但我无法以正确的方式调用函数!
这是我的代码:
import os
from gimpfu import *
inputPath = os.path.join('xxxx', 'fire.png')
if(file.lower().endswith(('.png'))):
image = pdb.file_png_load(inputPath, inputPath)
if(file.lower().endswith(('.jpeg', '.jpg'))):
image = pdb.file_jpeg_load(inputPath, inputPath)
drawable = pdb.gimp_image_get_active_layer(image)
pdb.plug_in_beautify(1,image,drawable,67,100)
# Traceback (most recent call last):
# File "<input>", line 1, in <module>
# TypeError: wrong number of parameters
pdb.plug_in_beautify.nparams # = 5
pdb.plug_in_beautify.params
# ((0, 'run-mode', 'The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }'),
# (13, 'image', 'Input image'),
# (16, 'drawable', 'Input drawable'),
# (0, 'effect', 'The effect to apply { SOFT_LIGHT (1), WARM (2), SHARPEN (3), SOFT (4), REMOVE_FOG (5), STRONG_CONTRAST (6), SMART_COLOR (7),... PINK_PURPLE_GRADIENG (80), PINK_BLUE_GRADIENT (81) }'),
# (3, 'opacity', 'The effect opacity (0 <= opacity <= 100)'))
那么为什么我的函数有 'wrong number of parameters' 如果它期望 5 而我输入 5?
任何人都可以帮助我了解正确的语法吗?
IMO 不应进入 运行-模式
编辑:
输入 pdb.plug_in_beautify(图片,drawable,67,100)
运行-模式未被python
使用(不需要)
我尝试在 python 命令行中使用很棒的 Beautify 插件,但我无法以正确的方式调用函数!
这是我的代码:
import os
from gimpfu import *
inputPath = os.path.join('xxxx', 'fire.png')
if(file.lower().endswith(('.png'))):
image = pdb.file_png_load(inputPath, inputPath)
if(file.lower().endswith(('.jpeg', '.jpg'))):
image = pdb.file_jpeg_load(inputPath, inputPath)
drawable = pdb.gimp_image_get_active_layer(image)
pdb.plug_in_beautify(1,image,drawable,67,100)
# Traceback (most recent call last):
# File "<input>", line 1, in <module>
# TypeError: wrong number of parameters
pdb.plug_in_beautify.nparams # = 5
pdb.plug_in_beautify.params
# ((0, 'run-mode', 'The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }'),
# (13, 'image', 'Input image'),
# (16, 'drawable', 'Input drawable'),
# (0, 'effect', 'The effect to apply { SOFT_LIGHT (1), WARM (2), SHARPEN (3), SOFT (4), REMOVE_FOG (5), STRONG_CONTRAST (6), SMART_COLOR (7),... PINK_PURPLE_GRADIENG (80), PINK_BLUE_GRADIENT (81) }'),
# (3, 'opacity', 'The effect opacity (0 <= opacity <= 100)'))
那么为什么我的函数有 'wrong number of parameters' 如果它期望 5 而我输入 5?
任何人都可以帮助我了解正确的语法吗?
IMO 不应进入 运行-模式
编辑: 输入 pdb.plug_in_beautify(图片,drawable,67,100)
运行-模式未被python
使用(不需要)