# Python3
# 图片文件在pictures文件夹
# 程序会生成pictures文件夹对应图片的二进制文件,保存在txt文件夹
import os
from PIL import Image
from os import listdir
def picture2code(filename1,filename2):
image_file = Image.open(filename1)
# 缩放成60*70
image_file = image_file.resize((60, 70))
# 转成黑白图像
image_file = image_file.convert('1')
width,height=image_fi
Python练习—画图软件生成的图像转成txt文件(只有0和1)
画图软件生成的图像转成txt文件(只有0和1)
摘要由CSDN通过智能技术生成