问题
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