因为我的图片的单通道的,所以用

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')就可以有各种颜色了

相关文章:

  • 2021-08-03
  • 2021-12-13
  • 2022-01-19
  • 2021-09-09
  • 2022-01-01
  • 2022-01-25
  • 2021-11-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2021-09-29
  • 2021-04-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案