Skip to content

Instantly share code, notes, and snippets.

@extrasleepy
Created March 15, 2022 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save extrasleepy/8cd8e9cf7c0e03b3cb6baf42aafebb0d to your computer and use it in GitHub Desktop.
Save extrasleepy/8cd8e9cf7c0e03b3cb6baf42aafebb0d to your computer and use it in GitHub Desktop.
import sys
from PIL import Image, ImageFont, ImageDraw
from inky.auto import auto
import time
import glob
from font_source_serif_pro import SourceSerifProSemibold
from font_source_sans_pro import SourceSansProSemibold
font_size = 100
#author_font = ImageFont.truetype(SourceSerifProSemibold, font_size)
quote_font = ImageFont.truetype(SourceSansProSemibold, font_size)
inky = auto(ask_user=False, verbose=False)
saturation = 1.0
rooms=[]
for filename in glob.glob('rooms/*.jfif'): #assuming jfif
im=Image.open(filename)
rooms.append(im)
print(len(rooms))
while True:
image = Image.new("RGB", (inky.width, inky.height), (255, 255, 255))
image2 = rooms[1] #temporarily changed to display one image
image.paste(image2, (0, 0))
image3 = rooms[2]
image.paste(image3, (300, 0))
quote_x = "hello,balls"
draw = ImageDraw.Draw(image)
draw.multiline_text((10,10),quote_x,fill=(255,255,0), font=quote_font, align="center")
draw.rectangle((150,150,200,200),fill=(255,0,0))
draw.line((300, 0, 300,450), fill=(255,107,0), width=10) #255,107,0 is a non-dithered orange
draw.rounded_rectangle((100, 350, 200, 420), fill=(0,255,0), outline=(0,0,255), width=10, radius=20)
inky.set_image(image, saturation=saturation)
inky.show()
time.sleep(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment