lucadentella / SPIFFS_ImageReader

5 stars 5 forks source link

Is possible to add transparency support? #2

Closed Danixu closed 3 years ago

Danixu commented 3 years ago

Hello,

I'm starting to use the ESP32 and I have seen your library that is perfect to load files from SPIFFS to a display, but then I have noticed that of course, bmp files doesn't has transparency. This is a problem if you want to overlap two images or just print a image near some text...

Is possible to add the posibility of use a color as transparency?

I have took a look into the library and looks like the way the image is sent doesn't allow it, but my programming level is a bit low and I preffer to ask to someone that surely know it better.

Best Regards and thanks!

lucadentella commented 3 years ago

Hi! This library takes care of loading the image from SPIFFS partition and send it to the Adafruit_GFX library to display it:

https://github.com/lucadentella/SPIFFS_ImageReader/blob/792c763f7e0efafb92435e130c8d792ab87d4c35/src/SPIFFS_ImageReader.cpp#L191-L192

Unfortunately, the Adafruit library (at the moment) doesn't support alpha channels / transparency.

I found this back buffer library which could help but I hadn't the chance to test it: https://github.com/jeanlemotan/jlm-back-buffer