Skip to content

Commit

Permalink
Merge pull request #49 from makermelissa/master
Browse files Browse the repository at this point in the history
Make it easier to run bmp example on Python
  • Loading branch information
makermelissa committed Mar 12, 2021
2 parents 3726a3b + 90e7871 commit e55b9be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/epd_bitmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

display.rotation = 0

FILENAME = "blinka154mono.bmp"
FILENAME = "blinka.bmp"


def read_le(s):
Expand All @@ -68,7 +68,7 @@ class BMPError(Exception):

def display_bitmap(epd, filename): # pylint: disable=too-many-locals, too-many-branches
try:
f = open("/" + filename, "rb")
f = open(filename, "rb")
except OSError:
print("Couldn't open file")
return
Expand Down
5 changes: 4 additions & 1 deletion examples/epd_pillow_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
# Crop and center the image
x = scaled_width // 2 - display.width // 2
y = scaled_height // 2 - display.height // 2
image = image.crop((x, y, x + display.width, y + display.height))
image = image.crop((x, y, x + display.width, y + display.height)).convert("RGB")

# Convert to Monochrome and Add dithering
# image = image.convert("1").convert("L")

# Display image.
display.image(image)
Expand Down

0 comments on commit e55b9be

Please sign in to comment.