https://github.com/lvgl/lv_lib_bmp
BMP decoder library for LVGL
https://github.com/lvgl/lv_lib_bmp
bmp c embedded lvgl
Last synced: 3 months ago
JSON representation
BMP decoder library for LVGL
- Host: GitHub
- URL: https://github.com/lvgl/lv_lib_bmp
- Owner: lvgl
- License: mit
- Archived: true
- Created: 2020-07-28T07:43:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-06-24T06:34:37.000Z (4 months ago)
- Last Synced: 2025-07-11T16:17:53.372Z (3 months ago)
- Topics: bmp, c, embedded, lvgl
- Language: C
- Homepage:
- Size: 85 KB
- Stars: 12
- Watchers: 3
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BMP decoder for LVGL
**This repository is merged into the lvgl repository and archived. See https://docs.lvgl.io/master/details/libs/bmp.html**
**This repository is merged into the lvgl repository and archived. See https://docs.lvgl.io/master/details/libs/lodepng.html**
Allow the use of BMP images in LVGL.
This implementation uses [bmp-decoder](https://github.com/caj-johnson/bmp-decoder) library.
The pixel are read on demand (not the whole image is loaded) so using BMP imgages requires very little RAM.Compatible with LVGL's `feat/new-fs-api` branch.
If you use the [lv_fs_if](https://github.com/lvgl/lv_fs_if) repository it's `new-api` branch should be used.## Get started
- Download or clone this repository
- [Download from GitHub](https://github.com/littlevgl/lv_lib_bmp/archive/master.zip)
- Clone: `git clone https://github.com/lvgl/lv_lib_bmp.git`
- Include the library: `#include "lv_lib_bmp/lv_bmp.h"`
- Initalize the decocer with `lv_bmp_init();`
- Test with the following code:
```c;
lv_obj_t * img = lv_img_create(lv_scr_act());
lv_img_set_src(img, "S/path/to/image.bmp");
```## Limitations
- BMP files can be loaded only from file. If you want to store them in flash it's better to convert them to C array with [LVGL's image converter](https://lvgl.io/tools/imageconverter).
- The BMP files color format needs to match with `LV_COLOR_DEPTH`. Use GIMP to save the image in the required format.
RGB888 and ARGB888 works with `LV_COLOR_DEPTH 32`
- Palette is not supported.