From 14a61e97b8887ac818a9311965094b505a9f4644 Mon Sep 17 00:00:00 2001 From: Fisch Date: Fri, 11 Nov 2022 21:10:28 +0100 Subject: [PATCH] move comments to top of file --- src/main.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1079543..0e9d6e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,22 @@ // Library, connections and info from: https://www.waveshare.com/wiki/E-Paper_ESP32_Driver_Board#Resource // Display: https://www.waveshare.com/product/4.2inch-e-paper.htm + +//Convert to 1 bit grayscale: +//maybe dither before +// convert image to array: +// python3 img2array.py -i image.png + +//Convert to 2 bit grayscale dithered: +// first convert image to dithered 2 bit image: +// convert testimage.png -dither FloydSteinberg -define dither:diffusion-amount=85% -remap 4gray.png -compress RLE -define png:color-type=6 output.png + +// then image to array: +// python3 img2array.py --bitdepth 2 --lsbfirst --colorlsbfirst testimage.png + +// then copy generated ...png.txt content to ImageData.cpp + + /* Includes ------------------------------------------------------------------*/ #include "DEV_Config.h" #include "EPD.h" @@ -38,7 +54,7 @@ void setup() printf("show image for array\r\n"); Paint_SelectImage(BWImage); Paint_Clear(WHITE); - Paint_DrawBitMap(gImage_4in2); //to convert image use: python3 img2array.py -i image.png + Paint_DrawBitMap(gImage_4in2); EPD_4IN2_Display(BWImage); free(BWImage); @@ -64,7 +80,7 @@ void setup() Paint_SelectImage(GSImage); Paint_SetScale(4); - Paint_DrawBitMap(gImage_4in2); //to convert 2-bit gray image to array: convert testimage.png -dither FloydSteinberg -define dither:diffusion-amount=85% -remap 4gray.png -compress RLE BMP3:output.bmp + Paint_DrawBitMap(gImage_4in2); EPD_4IN2_4GrayDisplay(GSImage); DEV_Delay_ms(10000);