Select by color doesn't select all the pixels of the desired color in a python-fu script

纵然是瞬间 提交于 2021-01-24 11:34:06

问题


I am writing a python-fu script for gimp that should have a line where it select all pixels of certain color. To do this, I added the line:

    gimp.pdb.gimp_by_color_select(clipLayer,(white_level,white_level,white_level),0,CHANNEL_OP_REPLACE,TRUE,FALSE,0,TRUE)

where cliLayer is the layer I'm working on (top layer) and white_level is an input parameter.

When I give the value manually (e.g replacing the (white_level,white_level,white_level) with (136,136,136)), the selection is carried properly, why is that so?


回答1:


Adding

white_level = int(white_level)

at the beginning of the function solve this.



来源:https://stackoverflow.com/questions/19075037/select-by-color-doesnt-select-all-the-pixels-of-the-desired-color-in-a-python-f

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!