1 2# GIF decoder 3Allow using GIF images in LVGL. Based on https://github.com/lecram/gifdec 4 5When enabled in `lv_conf.h` with `LV_USE_GIF` `lv_gif_create(parent)` can be used to create a gif widget. 6 7`lv_gif_set_src(obj, src)` works very similarly to `lv_img_set_src`. As source, it also accepts images as variables (`lv_img_dsc_t`) or files. 8 9 10## Convert GIF files to C array 11To convert a GIF file to byte values array use [LVGL's online converter](https://lvgl.io/tools/imageconverter). Select "Raw" color format and "C array" Output format. 12 13 14## Use GIF images from file 15For example: 16```c 17lv_gif_set_src(obj, "S:path/to/example.gif"); 18``` 19 20Note that, a file system driver needs to be registered to open images from files. Read more about it [here](https://docs.lvgl.io/master/overview/file-system.html) or just enable one in `lv_conf.h` with `LV_USE_FS_...` 21 22 23## Memory requirements 24To decode and display a GIF animation the following amount of RAM is required: 25- `LV_COLOR_DEPTH 8`: 3 x image width x image height 26- `LV_COLOR_DEPTH 16`: 4 x image width x image height 27- `LV_COLOR_DEPTH 32`: 5 x image width x image height 28 29## Example 30```eval_rst 31.. include:: ../../examples/libs/gif/index.rst 32``` 33 34## API 35 36```eval_rst 37.. doxygenfile:: lv_gif.h 38 :project: lvgl 39```