random stuff

This commit is contained in:
2019-10-04 05:26:45 -07:00
parent 45b3eb8ad5
commit 1675072561
6 changed files with 40 additions and 4 deletions

16
misc/tg.py Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python3
import time
import termgraphics
#g = termgraphics.TermGraphics(mode = termgraphics.MODE_EASCII)
g = termgraphics.TermGraphics()
g.clear()
for x in range(g.shape[0]):
y = int(0.5 * g.shape[1] * ((2*x/g.shape[0]-1)**3 + 1))
g.point((x,y))
g.draw()
time.sleep(0.1)

20
misc/tg2.py Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
import termgraphics
from PIL import Image, ImageOps
import requests
from io import BytesIO
import time
g = termgraphics.TermGraphics()
def get_image(url = 'https://devblogs.nvidia.com/parallelforall/wp-content/uploads/2016/07/cute.jpg'):
response = requests.get(url)
img = Image.open(BytesIO(response.content))
return img
if __name__ == "__main__":
img = get_image().resize((200//2,150//4), Image.NEAREST)
#print(img)
g.image(list(img.getdata()), img.width, img.height, (0, 0), image_type = termgraphics.IMAGE_RGB_2X4)