Skip to content

Instantly share code, notes, and snippets.

@nilskuhn
Last active February 15, 2019 07:01
Show Gist options
  • Save nilskuhn/b081039e36266155ca85103097d948ac to your computer and use it in GitHub Desktop.
Save nilskuhn/b081039e36266155ca85103097d948ac to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image,ImageDraw
import sys
import os
sys.path.append(os.path.abspath('..'))
from display import IMG_HEIGHT,IMG_WIDTH
import display.weather
import display.events
import display.pocketMoney
from waveshare import epd7in5
def paint(outputType):
image = Image.new('1', (IMG_WIDTH, IMG_HEIGHT), 255) # 255: clear the frame
draw = ImageDraw.Draw(image)
display.weather.paint(draw)
display.events.paint(draw)
display.pocketMoney.paint(draw)
if outputType == "png":
image.save("tests.png", "PNG")
image.rotate(90, expand = 1).save("tests_rotated.png", "PNG")
elif outputType == "epd":
ePaperDisplay = epd7in5.EPD()
ePaperDisplay.init()
ePaperDisplay.display(ePaperDisplay.getbuffer(image))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment