From 8146ef5b1386004ae00af19a5432c7df34caa647 Mon Sep 17 00:00:00 2001 From: Jochen Derwae Date: Tue, 12 Nov 2019 15:14:26 +0100 Subject: [PATCH] Added support for RGB 565 images (16 bit colors) and transparency bitmasks for use with a ST7789 (or similar) display. Look at the Adafruit_GFX::drawRGBBitmap functions for using these bitmaps. UI changes: - added a "Transparent" option in "Background color" selection - replaced drawMode radio buttons with a drop-down list - added a div (id=note1bit) around the note to switch to vertical mode Code changes: - added a ConversionFunctions object to hold the conversion functions (this makes it extendable towards more formats) - renamed imageToStringHorizontal() to horizontal1bit() - renamed imageToStringVertical() to vertical1bit() - added horizontal565() to generate 16 bit 565 RGB images - added horizontalAlpha() to generate transparency masks based on the image alpha value - added conversionFunction to settings object - added updateDrawMode() to handle the draw mode selection - also hides the note when using the new modes - updated place_image() to skip background fill in case transparency is selected - updated place_image(), commented out the conversion to black & white. Not sure at this time how to enable it again... drawMode? - updated imageToString() to use the conversionFunction from settings - moved getting the image raw data array from the conversion functions imageToString() --- index.html | 308 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 202 insertions(+), 106 deletions(-) diff --git a/index.html b/index.html index 257f9fd..1655415 100644 --- a/index.html +++ b/index.html @@ -235,6 +235,8 @@ + +
@@ -244,10 +246,10 @@
-
+
-
0 - 255; pixels with brightness above become white, below become black.
+
0 - 255; pixels with brightness above become white, below become blackpixels with alpha above become opaque, below transparent.
@@ -342,19 +344,23 @@
- - - - +
-
- If your image looks all messed up on your display, like the image below, try the other mode. +
+
+ If your image looks all messed up on your display, like the image below, try the other mode. +
+
-
@@ -365,6 +371,163 @@