image.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:codingTheMatrix 作者: RestrictedZone 项目源码 文件源码
def image2file(image, path):
    """ Writes an image in list of lists format to a file. Will work with
        either color or grayscale. """
    if isgray(image):
        img = gray2color(image)
    else:
        img = image
    with open(path, 'wb') as f:
        png.Writer(width=len(image[0]), height=len(image)).write(f,
            [_boxed2flat(r) for r in img])

## Display functions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号