用python把图片转成字符画

之前的文章小猪佩奇社会人motd相比大家已经看到了,其实原理就是把图片转成字符画。

项目地址:https://github.com/wang4yu6peng13/ImageToChar

下载代码

如果你没有git那么请先安装git

yum install git -y

git clone代码

git clone https://github.com/wang4yu6peng13/ImageToChar.git

测试图片-小猪佩奇.png

转换

python3 ascii.py  peiqi.png -o 1.txt --width=60 --height=4

-o 输出到文件

–width 指定宽度

–height指定高度

大家可以根据参数自己调整,好了把你喜欢的图片转成字符画吧

发表回复