{"id":18301379,"url":"https://github.com/lvgl/lv_lib_png","last_synced_at":"2025-04-05T14:30:51.648Z","repository":{"id":39634826,"uuid":"218498689","full_name":"lvgl/lv_lib_png","owner":"lvgl","description":"PNG decoder for LVGL","archived":false,"fork":false,"pushed_at":"2023-02-27T16:12:29.000Z","size":821,"stargazers_count":68,"open_issues_count":12,"forks_count":27,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-03T13:45:55.833Z","etag":null,"topics":["embedded","lvgl","png-decoder"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lvgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-10-30T10:13:11.000Z","updated_at":"2025-03-31T13:42:35.000Z","dependencies_parsed_at":"2024-01-23T22:08:31.166Z","dependency_job_id":"885d0327-05b2-4c70-8111-40299ec8631e","html_url":"https://github.com/lvgl/lv_lib_png","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvgl%2Flv_lib_png","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvgl%2Flv_lib_png/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvgl%2Flv_lib_png/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvgl%2Flv_lib_png/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvgl","download_url":"https://codeload.github.com/lvgl/lv_lib_png/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247352297,"owners_count":20925245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","lvgl","png-decoder"],"created_at":"2024-11-05T15:15:47.536Z","updated_at":"2025-04-05T14:30:51.262Z","avatar_url":"https://github.com/lvgl.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PNG decoder for LVGL\n\n**This repository is merged into the lvgl repository. See https://docs.lvgl.io/master/libs/png.html**\n\nAllow the use of PNG images in LVGL. This implementation uses [lodepng](https://github.com/lvandeve/lodepng) library.\n\n## Get started\n- Download or clone this repository\n  - [Download from GitHub](https://github.com/littlevgl/lv_lib_lodepng/archive/master.zip)\n  - Clone: `git clone https://github.com/littlevgl/lv_lib_png.git`\n- Include the library: `#include \"lv_lib_png/lv_png.h\"`\n- Initalize the decocer with `lv_png_init()`\n- Test with the following code:\n```c\n    LV_IMG_DECLARE(png_decoder_test);\n    lv_obj_t * img = lv_img_create(lv_scr_act());\n    lv_img_set_src(img, \u0026png_decoder_test);\n```\n\n## Use PNG images from file\nBy deafult `lodepng` uses C file IO API (e.g. `fopen`) and images can be opened like this:\n```c\nlv_img_set_src(img, \"./lv_lib_png/png_decoder_test.png\");\n```\n\nIf you want to make `lodepng` to use LVGL's file system API add `#define LV_PNG_USE_LV_FILESYSTEM  1` to the end of your`lv_conf.h`.\nIn this case you need to [register a driver](https://docs.lvgl.io/latest/en/html/overview/file-system.html) fo LVGL. The following functions are required:\n- `open_cb()`\n- `read_cb()`\n- `close_cb()`\n- `size_cb()`\n\nAfter that fiels can be opened like this:\n```c\nlv_img_set_src(img, \"P:lv_lib_lodepng/png_decoder_test.png\");\n```\n\n\nNote that the path of the file might be different.\n\n## Use PNG images from flash\nTo store a PNG image in flash it needs to be converted to C array with [Online Image converter](https://lvgl.io/tools/imageconverter). Choose `Raw with alpha` Color format and `C array` Output format. Copy the result C array to your project and use it like this:\n```c\n    LV_IMG_DECLARE(my_test_img);\n    lv_obj_t * img = lv_img_create(lv_scr_act(), NULL);\n    lv_img_set_src(img, \u0026my_test_img);\n```\n\n## Learn more\nTo learn more about the PNG decoder itself read [this blog post](https://blog.littlevgl.com/2018-10-05/png_converter)\n\nTo learn more about the Image decoder interface of LittlevGL read the realevant part of the [documentation](https://docs.littlevgl.com/en/html/overview/image.html#image-decoder).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvgl%2Flv_lib_png","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvgl%2Flv_lib_png","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvgl%2Flv_lib_png/lists"}