因为我的图片的单通道的,所以用
draw = ImageDraw.Draw(image) im_width, im_height = image.size
(left, right, top, bottom) = (info[1], info[2], info[3], info[4]) color=define.STANDARD_COLORS[info[0]%len(define.STANDARD_COLORS)] draw.line([(left, top), (left, bottom), (right, bottom),(right, top), (left, top)], width=4, fill=color)
的时候,fill的color无论用什么"red","green"都是灰色,所以要在
draw = ImageDraw.Draw(image)前面加上一句
image = image.convert('RGB')就可以有各种颜色了