Skip to content

Conversation

@NipponSunrise
Copy link

Summary

Baseline integration of libwebp v1.6.0 for Lime sys targets — no breaking changes. There are no Haxe/Lime API changes; existing loaders now consume static .webp just like PNG/JPEG:

Image.__fromFile(...) calls NativeCFFI.lime_image_load_file
Image.__fromBytes(...) calls NativeCFFI.lime_image_load_bytes

Why WebP

  • Smaller files at comparable quality and therefore smaller bundles and faster downloads (in our app, switching from PNG to WebP reduced the package by ~40% with no visible quality loss).
  • Lossy and lossless modes, with alpha in both.
  • Broad tooling support.

Release readiness (request for inclusion)

  • Low risk: no API changes; minimal surface area; decoding is wired through the existing image-loading path.
  • Proven behavior: identical to PNG/JPEG in verified environments.
  • High impact: sizable asset-size reductions and faster start-up/downloads for real projects.
  • Opt-in / no regressions: using WebP is optional; existing PNG/JPEG workflows remain unchanged. If someone encounters issues, they can simply avoid .webp assets with no impact on the rest of the pipeline.

Given the small change set, lack of breaking changes, and clear value, I hope this can be included in the next Lime release.

Status

Verified locally (build & functionality):

  • Android: arm64
  • Windows: x64

Community validation welcome:

  • Android: armv7, x86_64
  • Linux: x86, x86_64
  • macOS: x86_64, arm64
  • iOS: arm64

How to test

  • Add a .webp image to your OpenFL/Lime assets.
  • Load it as usual (e.g., Image.fromFile("assets/picture.webp") or Image.fromBytes(bytes)).
  • Confirm it renders anywhere PNG/JPEG works today.

Limitations

  • Animated WebP: only the first frame is decoded.
  • Encoding: native encoder is built, but there are no public Haxe/Lime encoding APIs in this PR.

@NipponSunrise
Copy link
Author

@player-03 This is about the iOS Simulator (x86_64), not iOS/ARM. The link errors are due to missing SSE2/SSE4.1 units; they need to be included for the simulator.

My old Mac Mini Sequoia Tahoe upgrade is done and the patch is almost ready. Let’s reduce code after CI is green—please avoid refactors for a moment. Thanks for cooperation.

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