# BMP Decoder (/libs/image_support/bmp)



This BMP Decoder utility allows you to use images from .BMP files in LVGL.

Instead of loading the whole image at once, BMP pixels are read on demand,
so using BMP images requires very little RAM.

If enabled in `lv_conf.h` by setting <ApiLink name="LV_USE_BMP" /> to `1`, LVGL will
register the BMP image decoder automatically so BMP files can be directly used as
image sources.  Example:

```c title=" " lineNumbers=1
lv_image_set_src(my_img, "S:path/to/picture.bmp");
```

Note that, a [File System (lv\_fs\_drv)](/main-modules/fs) driver needs to registered to open images from
files.  Follow the instructions in [File System (lv\_fs\_drv)](/main-modules/fs).

Limitations [#limitations]

* Only uncompressed BMP files are supported.  BMP images as C arrays
  (<ApiLink name="lv_image_dsc_t" />) are not supported.  This is because there is no
  practical difference between how uncompressed BMP files and LVGL's image format
  store the image data.
* The BMP file's color format needs to match the configured <ApiLink name="LV_COLOR_DEPTH" />
  of the display on which it will be rendered.  You can use GIMP to save the image
  in the required format.  Both RGB888 and ARGB888 work with
  <ApiLink name="LV_COLOR_DEPTH" /> `32`
* Color palettes are not supported.
* Because the whole image is not loaded, it cannot be zoomed or rotated.

Example [#example]

Open a BMP image from file [#open-a-bmp-image-from-file]

<LvglExample name="lv_example_bmp_1" path="libs/bmp/lv_example_bmp_1" />

API [#api]
