PIL

            pil=Image.open('D:/100.jpg').convert('L')
            #PIL image转换为array
            img1=np.asarray(img)
            #修改图片的读取格式
            img1.flags.writeable=True #将数组改写为读写模式
            img1=img1.astype(np.float)
            img=Image.fromarray(np.uint8(img1))
            img.show()
posted @ 2021-11-11 21:09  Tsukinousag1  阅读(238)  评论(0)    收藏  举报