0

私は PIL==1.1.7 を使用しています

ポリゴンを次のような色で塗りつぶそうとしています:

def save(self):
    try:
        image = Map.objects.all()[0].image
        im = Image.open(image.path)
        draw = ImageDraw.Draw(im)
        draw.polygon(((685,255),(714,361),(698,389),(610,411),(575,285)), fill=(255,255,255))

        del draw 
        format = 'png'
        im.save(image.path, format)
    except Exception, e:
        print e
        pass

しかし、私は例外を受け取ります:

invalid literal for int() with base 10: '\x8f'

それはこのように動作します:

draw.polygon(((685,255),(714,361),(698,389),(610,411),(575,285)), fill=128)

このエラーはどういう意味ですか?

画像に透明なポリゴンを描画しようとしています。

4

1 に答える 1