I have many image files as c_array in project.
It take a lot of space in memory.
Now I want to compress them (like zip file) and save into internal memory such as flash. When screen is drawed, I read compressed files from flash, de-compress them and display.
Is there that function(compress/de-compress the image) in LVGL library? @kisvegabor
I am using GUI Guider for creating UI.
As the Image widget, I added these png files, and generate source code.
Generated source code look like your sent page
at ## Use PNG images from flash.
So I think I am using png file.
Any method for reducing those files and not affect display quality when using. (As I talked above such as compress/de-compress)
I believe .png and .jpg files are highly compressed and there’s little you can do. But don’t take my word for it; try zipping a few files and see for yourself.
This is a known bug in the PHP converter. It’s fixed in the newer JavaScript-based converter. Editing the file and setting the width and height to 0 yourself should also work.
LVGL does not include a PNG decoder; it relies on lodepng for that.
Any of the listed options except “Raw” should work out of the box.
If I set w and h of direction_raw_alpha to { 0, 0 }, no image displayed
If I set w and h of direction_raw_alpha to its size { 100, 100 }, below image is displayed
In lv_png.c, _lv_img_decoder_t is used, but it is not existed in LVGL.
and I fixed to _lv_img_decoder, is it right?
I debug above code.
In decoder_open()
/*Decode the image in ARGB8888 */
error = lodepng_decode32(…)
At here I got an error, error number = 28
“incorrect PNG signature, it’s no PNG or corrupted”
I used your png data png_decoder_test.c
Did I miss anything such as #define in lv_conf.h when use lv_png library?
You can use the built-in functions provided by LVGL to compress and decompress image files. This will help reduce memory usage and enable efficient storage and retrieval of images from flash memory you can visit LVGL documentation for better understanding and for manually image compression you can go through the any online application such as https://jpegcompressor.com/ it compresses the image efficiently without losing their quality.