René's URL Explorer Experiment


Title: lv.image.set_src() silently fails on 8-bit RGBA PNGs (LV_COLOR_DEPTH=16, lodepng) · Issue #140 · MicroPythonOS/MicroPythonOS · GitHub

Open Graph Title: lv.image.set_src() silently fails on 8-bit RGBA PNGs (LV_COLOR_DEPTH=16, lodepng) · Issue #140 · MicroPythonOS/MicroPythonOS

X Title: lv.image.set_src() silently fails on 8-bit RGBA PNGs (LV_COLOR_DEPTH=16, lodepng) · Issue #140 · MicroPythonOS/MicroPythonOS

Description: Summary lv.image.set_src() called with an 8-bit RGBA PNG (PNG color type 6) succeeds without raising and prints no error, but the image widget stays at 0×0 pixels and nothing renders on screen. The same code path works correctly with ind...

Open Graph Description: Summary lv.image.set_src() called with an 8-bit RGBA PNG (PNG color type 6) succeeds without raising and prints no error, but the image widget stays at 0×0 pixels and nothing renders on screen. The...

X Description: Summary lv.image.set_src() called with an 8-bit RGBA PNG (PNG color type 6) succeeds without raising and prints no error, but the image widget stays at 0×0 pixels and nothing renders on screen. The...

Opengraph URL: https://github.com/MicroPythonOS/MicroPythonOS/issues/140

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lv.image.set_src() silently fails on 8-bit RGBA PNGs (LV_COLOR_DEPTH=16, lodepng)","articleBody":"## Summary\n\n`lv.image.set_src()` called with an 8-bit **RGBA** PNG (PNG color type 6) succeeds without raising and prints no error, but the image widget stays at 0×0 pixels and nothing renders on screen. The same code path works correctly with **indexed-palette** PNGs (color type 3). Hit this developing Lightning Piggy (com.lightningpiggy.displaywallet) on MPOS 0.10.0 — hero / icon / confetti graphics were all silently invisible until I converted them.\n\n## Environment\n\n- MicroPythonOS **0.10.0**\n- Board: Waveshare ESP32-S3 Touch LCD 2 (`waveshare_esp32_s3_touch_lcd_2`)\n- LVGL: bundled lvgl-micropython\n- `lv_conf.h` settings:\n  - `LV_COLOR_DEPTH 16` (via `MICROPY_COLOR_DEPTH = 16` → RGB565)\n  - `LV_USE_LODEPNG 1`\n  - `LV_USE_LIBPNG 0` (commented as `lv_libpng.c:14:10: fatal error: png.h: No such file or directory`)\n\n## Reproduction\n\nMinimal Python in any Activity:\n\n```python\nimg = lv.image(lv.screen_active())\nimg.set_src(\"M:path/to/some_rgba.png\")  # 8-bit RGBA, color type 6\nimg.set_size(80, 100)\nimg.center()\n# Result: widget is positioned correctly and not HIDDEN, but renders no pixels.\n# img.get_width() / get_height() return 0 before the explicit set_size, and\n# even after set_size the image content area is blank.\n```\n\nThe exact same code with an indexed-palette PNG renders correctly:\n\n```python\nimg.set_src(\"M:builtin/res/mipmap-mdpi/MicroPythonOS-logo-white-long-w296.png\")\n# (this file is color type 3 — renders fine)\n```\n\n## Reproducer PNGs\n\n| File | `file(1)` reports | Renders? |\n|---|---|---|\n| `M:builtin/res/mipmap-mdpi/MicroPythonOS-logo-white-long-w296.png` | `4-bit colormap, non-interlaced` (color type 3) | ✓ |\n| LP `hero_lightningpiggy.png` (80×100) | `8-bit/color RGBA, non-interlaced` (color type 6) | ✗ |\n| LP `hero_lightningpenguin.png` (78×100) | `8-bit/color RGBA, non-interlaced` (color type 6) | ✗ |\n| Same penguin/piggy after `Image.quantize(method=2)` → color type 3 | `8-bit colormap, non-interlaced` | ✓ |\n\nFiles I had problems with are pure 80×100 RGBA cartoons, ~8 KB. The PNG itself parses fine (valid IHDR, declared dims, valid magic bytes) — both `open(path, 'rb')` from MicroPython AND host-side decoders read them without complaint. It's only `lv.image.set_src()` that produces no output.\n\n## Diagnostics performed\n\n- Verified the FS driver works — `open()` from Python on the device reads the file fine via the `M:` driver path\n- Verified `lv.lodepng_init()` is exposed and callable; calling it from app `onCreate` doesn't change behaviour (suggests it's already inited, or it's not the missing piece)\n- `hero_image.get_width() / get_height()` return 0 after `set_src()` on RGBA PNGs (suggests the decoder isn't producing image header dims). `set_size(80,100)` forces non-zero bounds but the area still draws empty (suggests decoder doesn't produce pixel data either).\n- Painted a solid `bg_color` on the same widget instead — that renders correctly, ruling out z-order / overlay / clip issues\n- Used the MPOS-bundled indexed PNG (the launcher logo) as the src in the LP context — that renders fine, ruling out a path-prefix or filesystem-context issue\n- Converted my RGBA PNGs to indexed-palette via Pillow (`Image.quantize(colors=255, method=2, dither=FLOYDSTEINBERG)`) — those then render correctly on the same device, without code changes\n\n## Expected behaviour\n\n`lv.image.set_src()` with a valid 8-bit RGBA PNG should either render the image (preferred) or raise / print an error indicating the decoder rejected the format. Silent 0×0 is the worst-of-both: code looks like it succeeded.\n\n## Workaround\n\nConvert all 8-bit RGBA PNGs to indexed-palette before shipping. PIL one-liner:\n\n```python\nfrom PIL import Image\nImage.open(\"foo.png\").quantize(colors=255, method=2,\n    dither=Image.Dither.FLOYDSTEINBERG).save(\"foo.png\", optimize=True)\n```\n\nLightning Piggy added a `scripts/check_png_format.py` validator that walks `res/` and fails CI on any RGBA PNG, plus a `docs/assets.md` write-up of the constraint. Happy to upstream the validator if useful for other LP-style apps.\n\n## Likely root cause (speculation)\n\nThe combination `LV_COLOR_DEPTH=16` (RGB565 framebuffer) + lodepng + 8-bit RGBA source is a known interaction point in lvgl — the decoder needs to convert RGBA → RGB565 and the alpha-blending path may not be wired up correctly in this build. Indexed-palette PNGs go through a simpler code path (palette lookup with optional `tRNS` transparency) that doesn't hit the same code, which is consistent with what we observe. Probably worth a sanity check that the lvgl-micropython build is enabling the right `LV_DRAW_BUF_*` / colour-conversion flags for RGBA-on-RGB565.","author":{"url":"https://github.com/bitcoin3us","@type":"Person","name":"bitcoin3us"},"datePublished":"2026-05-20T15:34:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/140/MicroPythonOS/issues/140"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4eb21443-1c1a-d3f6-06d8-6e09ff10e743
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA42A:53234:41631D0:5C6DBFA:6A4FB44D
html-safe-noncecf8beb8725ad629d277d94909abdddb9adbc582a099341c6ea50a9abeadd3351
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDJBOjUzMjM0OjQxNjMxRDA6NUM2REJGQTo2QTRGQjQ0RCIsInZpc2l0b3JfaWQiOiIzMDY0MjA3NjU4NDg5NzIxOTMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca1b813e9fad6e6094633263e1ea4fd63e3a640c81713eb4a6435196f9dfdcb99
hovercard-subject-tagissue:4487812091
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/MicroPythonOS/MicroPythonOS/140/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b84f5ee63b40d6006934f0cfc9305bd8dacd013c749c784a8d697c062a74c824/MicroPythonOS/MicroPythonOS/issues/140
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b84f5ee63b40d6006934f0cfc9305bd8dacd013c749c784a8d697c062a74c824/MicroPythonOS/MicroPythonOS/issues/140
og:image:altSummary lv.image.set_src() called with an 8-bit RGBA PNG (PNG color type 6) succeeds without raising and prints no error, but the image widget stays at 0×0 pixels and nothing renders on screen. The...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebitcoin3us
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
go-importgithub.com/MicroPythonOS/MicroPythonOS git https://github.com/MicroPythonOS/MicroPythonOS.git
octolytics-dimension-user_id213598128
octolytics-dimension-user_loginMicroPythonOS
octolytics-dimension-repository_id975472483
octolytics-dimension-repository_nwoMicroPythonOS/MicroPythonOS
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id975472483
octolytics-dimension-repository_network_root_nwoMicroPythonOS/MicroPythonOS
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4b249b445842943ed31549e027f57a8ade9881ed
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/MicroPythonOS/MicroPythonOS/issues/140#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FMicroPythonOS%2FMicroPythonOS%2Fissues%2F140
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FMicroPythonOS%2FMicroPythonOS%2Fissues%2F140
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=MicroPythonOS%2FMicroPythonOS
Reloadhttps://github.com/MicroPythonOS/MicroPythonOS/issues/140
Reloadhttps://github.com/MicroPythonOS/MicroPythonOS/issues/140
Reloadhttps://github.com/MicroPythonOS/MicroPythonOS/issues/140
Please reload this pagehttps://github.com/MicroPythonOS/MicroPythonOS/issues/140
MicroPythonOS https://github.com/MicroPythonOS
MicroPythonOShttps://github.com/MicroPythonOS/MicroPythonOS
Notifications https://github.com/login?return_to=%2FMicroPythonOS%2FMicroPythonOS
Fork 82 https://github.com/login?return_to=%2FMicroPythonOS%2FMicroPythonOS
Star 737 https://github.com/login?return_to=%2FMicroPythonOS%2FMicroPythonOS
Code https://github.com/MicroPythonOS/MicroPythonOS
Issues 23 https://github.com/MicroPythonOS/MicroPythonOS/issues
Pull requests 7 https://github.com/MicroPythonOS/MicroPythonOS/pulls
Discussions https://github.com/MicroPythonOS/MicroPythonOS/discussions
Actions https://github.com/MicroPythonOS/MicroPythonOS/actions
Projects https://github.com/MicroPythonOS/MicroPythonOS/projects
Security and quality 0 https://github.com/MicroPythonOS/MicroPythonOS/security
Insights https://github.com/MicroPythonOS/MicroPythonOS/pulse
Code https://github.com/MicroPythonOS/MicroPythonOS
Issues https://github.com/MicroPythonOS/MicroPythonOS/issues
Pull requests https://github.com/MicroPythonOS/MicroPythonOS/pulls
Discussions https://github.com/MicroPythonOS/MicroPythonOS/discussions
Actions https://github.com/MicroPythonOS/MicroPythonOS/actions
Projects https://github.com/MicroPythonOS/MicroPythonOS/projects
Security and quality https://github.com/MicroPythonOS/MicroPythonOS/security
Insights https://github.com/MicroPythonOS/MicroPythonOS/pulse
lv.image.set_src() silently fails on 8-bit RGBA PNGs (LV_COLOR_DEPTH=16, lodepng)https://github.com/MicroPythonOS/MicroPythonOS/issues/140#top
https://github.com/bitcoin3us
bitcoin3ushttps://github.com/bitcoin3us
on May 20, 2026https://github.com/MicroPythonOS/MicroPythonOS/issues/140#issue-4487812091
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.