initial commit WIP
BIN
Font.ttc
Normal file
11
N-color.gpl
Normal file
|
@ -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
|
46
act_to_gpl.py
Executable file
|
@ -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])
|
||||
)
|
||||
|
43
image2eink.py
Executable file
|
@ -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()
|
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_0606_20221012171522_20221012142734.jpg
Normal file
After Width: | Height: | Size: 359 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_0714_20221012171522_20221012142709.jpg
Normal file
After Width: | Height: | Size: 280 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_1299_20221012171522_20221012142649.jpg
Normal file
After Width: | Height: | Size: 334 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_2078_20221012171522_20221012142757.jpg
Normal file
After Width: | Height: | Size: 340 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_2082_20221012171522_20221012142809.jpg
Normal file
After Width: | Height: | Size: 237 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_2286_20221012171522_20221012142822.jpg
Normal file
After Width: | Height: | Size: 334 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_2441_20221012172936_20221012143038.jpg
Normal file
After Width: | Height: | Size: 453 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_2559_20221012171522_20221012142851.jpg
Normal file
After Width: | Height: | Size: 374 KiB |
After Width: | Height: | Size: 132 KiB |
BIN
pic/PagePrincipale_IMG_2831_20221012172936_20221012143023.jpg
Normal file
After Width: | Height: | Size: 450 KiB |
4
pic/convert-img-to-eink.sh
Executable file
|
@ -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
|
BIN
pic/eleana-converted.bmp
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
pic/eleana.jpeg
Normal file
After Width: | Height: | Size: 578 KiB |
BIN
pic/mrflos-bateau-converted.bmp
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
pic/mrflos-bateau.JPG
Normal file
After Width: | Height: | Size: 912 KiB |
BIN
pic/palette.gif
Normal file
After Width: | Height: | Size: 64 B |
28
test_buttons.py
Normal file
|
@ -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)
|