我不确定发生了什么。这东西以前有效,现在无效。
def generate_unity_texture(self, monKey_data):
width, height = self.texture_image.size
eye_position = (int(0.88 * width), int(0.88 * height))
ImageDraw.floodfill(unity_texture_copy, xy=eye_position , value=monKey_data['eye_color'])
return unity_texture_copy
我明白了SystemError: new style getargs format but argument is not a tuple
。问题出在pixel[x, y] = value
并提到有问题的代码行是 PIL\ImageDraw.py",第 349 行,在 floodfill
这是一个元组。我什至尝试将中间替换为(int(middle[0]), int(middle[1])
但得到了相同的结果。在文档xy
中是:
xy - 种子位置(2 项坐标元组)。
这正是我所做的。
有什么建议么?