Hi all,
I am currently playing around with loading images with LVGL, and due to low ram and the fact I am currently using a very simple image I thought I would try to use indexed binary images from the online lvgl image converter.
As a base point, I am using the lvgl 7 micropython bindings on an esp32 using an ili9341 display (as well as another display with a driver based on the one from the ili9341).
When creating the indexed images I used both standard pngs, as well as indexed ones using GIMP as suggested below on the page.
All of the indexed images (2, 4, 16, color as 256 would not fit in the ram) showed on offset, increasing with decreasing size
Origional image:
2 colour binary image from a standard png
4 colour binary image from a standard png
Additionally, when creating the binary from an indexed png the colours are wrong:
Here is the code used to load the images
scr = lv.obj()
with open('/images/standard/WFace_2bit.bin') as f:
img_data = f.read()
img_dsc = lv.img_dsc_t(
{
"header": {"always_zero": 0, "w": 240, "h": 240, "cf": lv.img.CF.INDEXED_2BIT},
"data_size": len(img_data),
"data": img_data,
}
)
bg = lv.img(scr)
bg.set_src(img_dsc)
lv.scr_load(scr)
Has anyone else had similar issues to this?
** Edit
having done a bit more testing it seems that the amount of pixels the image is offset by is a factor of two in all cases:
- The 1 bit image had an offset of 32 pixels
- The 2 bit image had an offset of 16 pixels
- The 4 bit image had an offset of 8 pixels