swee / Image to IRC
0 喜歡
0 分支
1 檔案
最後活躍 1 month ago
Converts an image to half-block ascii art with IRC color codes. Uses some code from SCIFv1
| 1 | from PIL import Image |
| 2 | import requests |
| 3 | from io import BytesIO |
| 4 | imraw = requests.get("https://cdn.swee.codes/charimgs/altsweecat5.png").content |
| 5 | im = Image.open(BytesIO(imraw)).convert("RGBA") |
| 6 | if im.width > 64: |
| 7 | new_height = int((64 / im.width) * im.height) |
| 8 | im = im.resize((64, new_height)) |
| 9 | px = im.load() |
| 10 | sz = im.size |
上一頁
下一頁