zoukankan      html  css  js  c++  java
  • PIL的ImageDraw的颜色问题

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

    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')就可以有各种颜色了
  • 相关阅读:
    Servlet Class4
    Servlet Class3
    Servlet Class2
    Servlet Class1
    HTTP基础知识
    XML基础知识
    JAVA Class25
    JAVA Class24
    JAVA Class23
    JAVA Class22
  • 原文地址:https://www.cnblogs.com/tangmiao/p/10172814.html
Copyright © 2011-2022 走看看