Replies: 2 comments
-
4-bit color is not really feasible. You might assign them RGGB but I think the results would look awful. The driver's use of a LUT enables a fixed set of 16 colors but I can't see how to employ this for general purpose image display. |
Beta Was this translation helpful? Give feedback.
-
So I've been spending a bit of time thinking about this... and implementing some tiny POCs. I think some use can be had out of 4-bit/16 color. It was certainly useful a few decades ago (and still today in some terminals) 😜 , I agree for the majority of use cases more colors is easier. I think for some carton and pixel art use cases it could work. It turns out with the CYD2 device I'm playing with, I have less memory available, not enough for 8-bit color framebuffer (with I think the same firmware of MicroPython installed as my CYD1 which does not have this issue) so I've been forced to think about this some more. I made a quick PNG (see clach04/cyd_clocks#40) using the palette defined in https://github.com/peterhinch/micropython-nano-gui/blob/master/gui/core/colors.py with the same palette (in the same index locations), with some greys thrown into positions; 12, 13, and 14 I was able to put together a super tiny pixelart demo together using that palette (and https://pydpainter.org/), in person it looks alright (it doesn't come out well in photos peterhinch/micropython-font-to-py#71 (comment)). If I was to load a different palette at the same time as the raw bitmap it would have more options. I don't really want to create a new image format but I may have too if I want to progress this. I was thinking about cloning the format output by img_cvt.py and adding a palette somewhere (ideally before the bitmap, after the resolution but this would be incompatible with the existing format, after might be better for that ). I'm looking to create a Bubble Bobble clock for someone, and the existing sprites I found happen to be 4-bit so I'm optimistic I'll be able to pull something off :-) As always, thanks for such a nice/well-documented library. Saved me a bunch of work implementing low-level stuff 😃 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have some CYD devices (both CYD1 and CYD2) as described by project https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display/
I put together a working show fullscreen image test/demos. It's working but the nano-gui demo one could do with more work, possibly documentation related.
I have a 16-bit demo (NOT using nano-gui) in https://github.com/clach04/cyd_clocks/blob/main/bitmap_fullscreen.py which works well with demo images (once converted using https://github.com/rdagger/micropython-ili9341/blob/master/utils/img2rgb565.py) in https://github.com/clach04/cyd_clocks/tree/main/images, for example:
https://github.com/clach04/cyd_clocks/blob/main/images/Philips_PM5544.png
I have this working with the 8-bit driver in color https://github.com/peterhinch/micropython-nano-gui/blob/master/drivers/ili93xx/ili9341_8bit.py
I have this working with the 4-bit driver in grayscale https://github.com/peterhinch/micropython-nano-gui/blob/master/drivers/ili93xx/ili9341.py
I can not see a way to get this working in 4-bit color (out-of-box), as it looks like https://github.com/peterhinch/micropython-nano-gui/blob/master/img_cvt.py doesn't support this. Has anyone looked into this at all? I'm speculating that images could be converted into raw 4-bit color (i.e. 2 pixels per byte). And probably need some way to set/load a palette?
I think I still have enough memory to do what I want to do with 8-bit color but trying to think of backup plans 😉
Beta Was this translation helpful? Give feedback.
All reactions