Skip to content

Conversation

@terry0012
Copy link
Contributor

Add webp image format support

Notes

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

Hi 👋, thank you for your PR!

We've run benchmarks in an emulated environment. Here are the results:

ARM Emulated 32b - lv_conf_perf32b

Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
All scenes avg. 28 38 7 7 0
Detailed Results Per Scene
Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
Empty screen 11 33 0 0 0
Moving wallpaper 2 33 1 1 0
Single rectangle 0 50 0 0 0
Multiple rectangles 0 38 (-4) 0 0 0
Multiple RGB images 0 38 (-1) 0 0 0
Multiple ARGB images 8 (-4) 43 (+1) 0 0 0
Rotated ARGB images 54 (+1) 44 (+1) 15 (+1) 15 (+1) 0
Multiple labels 7 (-1) 35 (+2) 0 0 0
Screen sized text 97 (+1) 47 20 20 0
Multiple arcs 33 (-2) 33 7 (+1) 7 (+1) 0
Containers 1 (-4) 37 (-1) 0 0 0
Containers with overlay 97 (+5) 21 44 44 0
Containers with opa 17 (+4) 37 0 0 0
Containers with opa_layer 18 (-1) 33 (-1) 6 (+1) 6 (+1) 0
Containers with scrolling 45 (-2) 46 12 12 0
Widgets demo 68 (+1) 40 16 16 0
All scenes avg. 28 38 7 7 0

ARM Emulated 64b - lv_conf_perf64b

Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
All scenes avg. 24 38 6 6 0
Detailed Results Per Scene
Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
Empty screen 11 33 0 0 0
Moving wallpaper 1 33 0 0 0
Single rectangle 0 50 (+1) 0 0 0
Multiple rectangles 0 46 0 0 0
Multiple RGB images 0 39 0 0 0
Multiple ARGB images 1 38 0 0 0
Rotated ARGB images 29 34 9 9 0
Multiple labels 3 44 (+1) 0 0 0
Screen sized text 82 (+1) 45 17 17 0
Multiple arcs 33 33 (-1) 6 6 0
Containers 4 38 (-1) 0 0 0
Containers with overlay 87 23 41 41 0
Containers with opa 18 38 0 0 0
Containers with opa_layer 7 36 1 1 0
Containers with scrolling 44 46 12 (+1) 12 (+1) 0
Widgets demo 66 42 15 15 0
All scenes avg. 24 38 6 6 0

Disclaimer: These benchmarks were run in an emulated environment using QEMU with instruction counting mode.
The timing values represent relative performance metrics within this specific virtualized setup and should
not be interpreted as absolute real-world performance measurements. Values are deterministic and useful for
comparing different LVGL features and configurations, but may not correlate directly with performance on
physical hardware. The measurements are intended for comparative analysis only.


🤖 This comment was automatically generated by a bot.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 24 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="docs/src/details/libs/libwebp.rst">

<violation number="1" location="docs/src/details/libs/libwebp.rst:42">
Link the WebP libraries to the `lvgl` target so the dependency follows LVGL; otherwise shared builds or other consumers miss the WebP symbols.</violation>
</file>

<file name="examples/libs/libwebp/index.rst">

<violation number="1" location="examples/libs/libwebp/index.rst:2">
The heading underline is shorter than the title text, which causes a &quot;Title underline too short&quot; error in Sphinx/docutils. Please extend the underline by at least one hyphen so it matches or exceeds the title length.</violation>
</file>

<file name="scripts/gen_json/gen_json.py">

<violation number="1" location="scripts/gen_json/gen_json.py:67">
Add a trailing comma after `&#39;LV_USE_LIBWEBP&#39;` so the tuple contains separate entries for WEBP and GIF; without it, both config macros stay disabled.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

find_package(PkgConfig REQUIRED)
pkg_check_modules(WebP REQUIRED IMPORTED_TARGET libwebp)
target_include_directories(lvgl PUBLIC ${WebP_INCLUDE_DIRS})
target_link_libraries(main ${WebP_LIBRARIES})
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link the WebP libraries to the lvgl target so the dependency follows LVGL; otherwise shared builds or other consumers miss the WebP symbols.

Prompt for AI agents
Address the following comment on docs/src/details/libs/libwebp.rst at line 42:

<comment>Link the WebP libraries to the `lvgl` target so the dependency follows LVGL; otherwise shared builds or other consumers miss the WebP symbols.</comment>

<file context>
@@ -0,0 +1,71 @@
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(WebP REQUIRED IMPORTED_TARGET libwebp)
+    target_include_directories(lvgl PUBLIC ${WebP_INCLUDE_DIRS})
+    target_link_libraries(main ${WebP_LIBRARIES})
+
+.. _libwebp_usage:
</file context>
Fix with Cubic

@terry0012 terry0012 force-pushed the webp_decoder branch 2 times, most recently from 3814184 to eda7ef8 Compare November 1, 2025 04:41
@FASTSHIFT FASTSHIFT requested a review from Copilot November 1, 2025 05:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds WebP image format support to LVGL by integrating the libwebp library. The implementation follows the existing pattern used by other image decoders in LVGL.

Key changes:

  • Added libwebp decoder integration with functions for initialization, deinitialization, and decoding WebP images
  • WebP images are decoded into ARGB8888 format with support for lossy, lossless, and transparent variants
  • Updated build system (CMake, Kconfig) to include libwebp dependencies and configuration options

Reviewed Changes

Copilot reviewed 19 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/libs/libwebp/lv_libwebp.c Core decoder implementation with info, open, and close callbacks
src/libs/libwebp/lv_libwebp.h Public API header declaring init/deinit functions
src/lv_init.c Calls lv_libwebp_init() during LVGL initialization
src/lv_conf_internal.h Configuration macro for enabling libwebp
lv_conf_template.h User-facing configuration template
tests/CMakeLists.txt CMake integration for linking libwebp in tests
tests/src/test_cases/libs/test_libwebp.c Test case covering lossy, lossless, and transparent WebP files
examples/libs/libwebp/lv_example_libwebp_1.c Example demonstrating WebP image loading
docs/src/details/libs/libwebp.rst Documentation covering installation, integration, and usage
Kconfig Configuration option for libwebp

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@terry0012 terry0012 force-pushed the webp_decoder branch 5 times, most recently from 0e91aca to 6a7081c Compare November 1, 2025 11:29
@FASTSHIFT FASTSHIFT requested a review from Copilot November 1, 2025 12:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 26 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/libs/libwebp/lv_libwebp.c:1

  • Line 104 comment appears to have a copy-paste error: it says 'VP8(L)' in the calculation but should say 'VP8' since this is describing the VP8 format (not VP8L). The chunk header and frame header should refer to VP8, not VP8(L).
/**

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@terry0012 terry0012 force-pushed the webp_decoder branch 2 times, most recently from 2a2c5ac to 50c9bbf Compare November 1, 2025 14:31
@FASTSHIFT FASTSHIFT requested a review from Copilot November 1, 2025 15:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 26 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@terry0012 terry0012 force-pushed the webp_decoder branch 2 times, most recently from a0bd50f to b7a45a8 Compare November 2, 2025 00:31
@AndreCostaaa AndreCostaaa changed the title feat(decoder): add webp decoder feat(image_decoder): add webp decoder Nov 2, 2025
FASTSHIFT
FASTSHIFT previously approved these changes Nov 4, 2025
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
@FASTSHIFT FASTSHIFT enabled auto-merge (squash) November 5, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants