diff --git a/Font.ttc b/Font.ttc new file mode 100644 index 0000000..4cbb7c5 Binary files /dev/null and b/Font.ttc differ diff --git a/N-color.gpl b/N-color.gpl new file mode 100644 index 0000000..0ea55d4 --- /dev/null +++ b/N-color.gpl @@ -0,0 +1,11 @@ +GIMP Palette +Name: N-color.act +Columns: 0 +# +0 0 0 Untitled +0 0 255 Untitled +255 0 0 Untitled +0 255 0 Untitled +255 128 0 Untitled +255 255 0 Untitled +255 255 255 Untitled diff --git a/act_to_gpl.py b/act_to_gpl.py new file mode 100755 index 0000000..10a1061 --- /dev/null +++ b/act_to_gpl.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +# +# Adobe Photoshop "*.act" palette file conversion to GIMP "*.gpl" palette +# format (which is also recognized by many other tools). +# +# How to use: +# ./act_to_gpl.py some_palette.act > some_palette.gpl +# +# Code based on swatchbook/codecs/adobe_act.py from: +# http://www.selapa.net/swatchbooker/ + + +import os.path +import struct +import sys + + +def parse_adobe_act(filename): + filesize = os.path.getsize(filename) + with open(filename, 'rb') as file: + if filesize == 772: # CS2 + file.seek(768, 0) + nbcolors = struct.unpack('>H', file.read(2))[0] + file.seek(0, 0) + else: + nbcolors = filesize // 3 + + # List of (R, G, B) tuples. + return [struct.unpack('3B', file.read(3)) for i in range(nbcolors)] + + +def return_gimp_palette(colors, name, columns=0): + return 'GIMP Palette\nName: {name}\nColumns: {columns}\n#\n{colors}\n'.format( + name=name, + columns=columns, + colors='\n'.join( + '{0} {1} {2}\tUntitled'.format(*color) + for color in colors + ), + ) + +if __name__ == '__main__': + sys.stdout.write( + return_gimp_palette(parse_adobe_act(sys.argv[1]), sys.argv[1]) + ) + diff --git a/image2eink.py b/image2eink.py new file mode 100755 index 0000000..26e2c99 --- /dev/null +++ b/image2eink.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# -*- coding:utf-8 -*- +import sys +import os +picdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pic') +libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib') +if os.path.exists(libdir): + sys.path.append(libdir) + +import logging +from waveshare_epd import epd5in65f +import time +from PIL import Image,ImageDraw,ImageFont +import traceback + +logging.basicConfig(level=logging.DEBUG) + +try: + logging.info("epd5in65f Demo") + + epd = epd5in65f.EPD() + logging.info("Init") + epd.init() + #epd.Clear() + while True: + for root, directories, files in os.walk(picdir): + for f in files: + if(f.endswith("converted.bmp")) : + logging.info("Read bmp file "+f) + Himage = Image.open(os.path.join(picdir, f)) + epd.display(epd.getbuffer(Himage)) + time.sleep(30) + #epd.Clear() + logging.info("Goto Sleep...") + epd.sleep() + +except IOError as e: + logging.info(e) + +except KeyboardInterrupt: + logging.info("ctrl + c:") + epd5in65f.epdconfig.module_exit() + exit() diff --git a/pic/PagePrincipale_IMG_0606_20221012171522_20221012142734-converted.bmp b/pic/PagePrincipale_IMG_0606_20221012171522_20221012142734-converted.bmp new file mode 100644 index 0000000..da53487 Binary files /dev/null and b/pic/PagePrincipale_IMG_0606_20221012171522_20221012142734-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_0606_20221012171522_20221012142734.jpg b/pic/PagePrincipale_IMG_0606_20221012171522_20221012142734.jpg new file mode 100644 index 0000000..faa0f28 Binary files /dev/null and b/pic/PagePrincipale_IMG_0606_20221012171522_20221012142734.jpg differ diff --git a/pic/PagePrincipale_IMG_0714_20221012171522_20221012142709-converted.bmp b/pic/PagePrincipale_IMG_0714_20221012171522_20221012142709-converted.bmp new file mode 100644 index 0000000..9028b8e Binary files /dev/null and b/pic/PagePrincipale_IMG_0714_20221012171522_20221012142709-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_0714_20221012171522_20221012142709.jpg b/pic/PagePrincipale_IMG_0714_20221012171522_20221012142709.jpg new file mode 100644 index 0000000..5c732a5 Binary files /dev/null and b/pic/PagePrincipale_IMG_0714_20221012171522_20221012142709.jpg differ diff --git a/pic/PagePrincipale_IMG_1299_20221012171522_20221012142649-converted.bmp b/pic/PagePrincipale_IMG_1299_20221012171522_20221012142649-converted.bmp new file mode 100644 index 0000000..e3a6da5 Binary files /dev/null and b/pic/PagePrincipale_IMG_1299_20221012171522_20221012142649-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_1299_20221012171522_20221012142649.jpg b/pic/PagePrincipale_IMG_1299_20221012171522_20221012142649.jpg new file mode 100644 index 0000000..11a3cda Binary files /dev/null and b/pic/PagePrincipale_IMG_1299_20221012171522_20221012142649.jpg differ diff --git a/pic/PagePrincipale_IMG_2078_20221012171522_20221012142757-converted.bmp b/pic/PagePrincipale_IMG_2078_20221012171522_20221012142757-converted.bmp new file mode 100644 index 0000000..ea581fb Binary files /dev/null and b/pic/PagePrincipale_IMG_2078_20221012171522_20221012142757-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_2078_20221012171522_20221012142757.jpg b/pic/PagePrincipale_IMG_2078_20221012171522_20221012142757.jpg new file mode 100644 index 0000000..7e335b5 Binary files /dev/null and b/pic/PagePrincipale_IMG_2078_20221012171522_20221012142757.jpg differ diff --git a/pic/PagePrincipale_IMG_2082_20221012171522_20221012142809-converted.bmp b/pic/PagePrincipale_IMG_2082_20221012171522_20221012142809-converted.bmp new file mode 100644 index 0000000..373efe8 Binary files /dev/null and b/pic/PagePrincipale_IMG_2082_20221012171522_20221012142809-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_2082_20221012171522_20221012142809.jpg b/pic/PagePrincipale_IMG_2082_20221012171522_20221012142809.jpg new file mode 100644 index 0000000..deecb36 Binary files /dev/null and b/pic/PagePrincipale_IMG_2082_20221012171522_20221012142809.jpg differ diff --git a/pic/PagePrincipale_IMG_2286_20221012171522_20221012142822-converted.bmp b/pic/PagePrincipale_IMG_2286_20221012171522_20221012142822-converted.bmp new file mode 100644 index 0000000..872e97f Binary files /dev/null and b/pic/PagePrincipale_IMG_2286_20221012171522_20221012142822-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_2286_20221012171522_20221012142822.jpg b/pic/PagePrincipale_IMG_2286_20221012171522_20221012142822.jpg new file mode 100644 index 0000000..e0bbf32 Binary files /dev/null and b/pic/PagePrincipale_IMG_2286_20221012171522_20221012142822.jpg differ diff --git a/pic/PagePrincipale_IMG_2441_20221012172936_20221012143038-converted.bmp b/pic/PagePrincipale_IMG_2441_20221012172936_20221012143038-converted.bmp new file mode 100644 index 0000000..b647ba6 Binary files /dev/null and b/pic/PagePrincipale_IMG_2441_20221012172936_20221012143038-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_2441_20221012172936_20221012143038.jpg b/pic/PagePrincipale_IMG_2441_20221012172936_20221012143038.jpg new file mode 100644 index 0000000..8d130b9 Binary files /dev/null and b/pic/PagePrincipale_IMG_2441_20221012172936_20221012143038.jpg differ diff --git a/pic/PagePrincipale_IMG_2559_20221012171522_20221012142851-converted.bmp b/pic/PagePrincipale_IMG_2559_20221012171522_20221012142851-converted.bmp new file mode 100644 index 0000000..e6bb159 Binary files /dev/null and b/pic/PagePrincipale_IMG_2559_20221012171522_20221012142851-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_2559_20221012171522_20221012142851.jpg b/pic/PagePrincipale_IMG_2559_20221012171522_20221012142851.jpg new file mode 100644 index 0000000..b8903c4 Binary files /dev/null and b/pic/PagePrincipale_IMG_2559_20221012171522_20221012142851.jpg differ diff --git a/pic/PagePrincipale_IMG_2831_20221012172936_20221012143023-converted.bmp b/pic/PagePrincipale_IMG_2831_20221012172936_20221012143023-converted.bmp new file mode 100644 index 0000000..e9daac0 Binary files /dev/null and b/pic/PagePrincipale_IMG_2831_20221012172936_20221012143023-converted.bmp differ diff --git a/pic/PagePrincipale_IMG_2831_20221012172936_20221012143023.jpg b/pic/PagePrincipale_IMG_2831_20221012172936_20221012143023.jpg new file mode 100644 index 0000000..f424188 Binary files /dev/null and b/pic/PagePrincipale_IMG_2831_20221012172936_20221012143023.jpg differ diff --git a/pic/convert-img-to-eink.sh b/pic/convert-img-to-eink.sh new file mode 100755 index 0000000..5233a16 --- /dev/null +++ b/pic/convert-img-to-eink.sh @@ -0,0 +1,4 @@ +#!/bin/bash +convert xc:"rgb(0, 0, 0)" xc:"rgb(0, 0, 255)" xc:"rgb(255, 0, 0)" xc:"rgb(0, 255, 0)" xc:"rgb(255, 128, 0)" xc:"rgb(255, 255, 0)" xc:"rgb(255, 255, 255)" +append palette.gif +filename=$1 +convert $filename -resize 600x448^ -gravity center -extent 600x448 -remap palette.gif ${filename%.*}-converted.bmp diff --git a/pic/eleana-converted.bmp b/pic/eleana-converted.bmp new file mode 100644 index 0000000..0b7aa93 Binary files /dev/null and b/pic/eleana-converted.bmp differ diff --git a/pic/eleana.jpeg b/pic/eleana.jpeg new file mode 100644 index 0000000..b93b3e2 Binary files /dev/null and b/pic/eleana.jpeg differ diff --git a/pic/mrflos-bateau-converted.bmp b/pic/mrflos-bateau-converted.bmp new file mode 100644 index 0000000..0d34ac9 Binary files /dev/null and b/pic/mrflos-bateau-converted.bmp differ diff --git a/pic/mrflos-bateau.JPG b/pic/mrflos-bateau.JPG new file mode 100644 index 0000000..21b4085 Binary files /dev/null and b/pic/mrflos-bateau.JPG differ diff --git a/pic/palette.gif b/pic/palette.gif new file mode 100644 index 0000000..70664f2 Binary files /dev/null and b/pic/palette.gif differ diff --git a/test_buttons.py b/test_buttons.py new file mode 100644 index 0000000..d064c26 --- /dev/null +++ b/test_buttons.py @@ -0,0 +1,28 @@ +from gpiozero import Button +from time import sleep + +btn1 = Button(21) +btn2 = Button(22) +btn3 = Button(23) +btn4 = Button(24) +btn5 = Button(25) +btn6 = Button(26) + + +def handleBtnPress(btn): + pinNum = btn.pin.number + print("button pressed = "+pinNum) + + +# tell the button what to do when pressed +btn1.when_pressed = handleBtnPress +btn2.when_pressed = handleBtnPress +btn3.when_pressed = handleBtnPress +btn4.when_pressed = handleBtnPress +btn5.when_pressed = handleBtnPress +btn6.when_pressed = handleBtnPress + + +while True: + print("Press button") + sleep(3)