-
Notifications
You must be signed in to change notification settings - Fork 647
feat(webp): WebP Image Export Implementation #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit introduces unit tests for the toWebp function. The tests cover: - Basic WebP image generation from an HTML node. - WebP image generation with a specified quality parameter. Associated test image resources (image-webp and image-webp-low) have also been added to support these test cases.
This commit introduces the `toWebp` function. Closes bubkoo#465
This commit adds documentation for the newly implemented `toWebp` function. This will help users understand how to utilize the WebP export functionality.
👋 @dodok8 💖 Thanks for opening this pull request! 💖 Please follow the contributing guidelines. And we use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #530 +/- ##
=======================================
Coverage 66.50% 66.50%
=======================================
Files 10 10
Lines 612 612
Branches 150 150
=======================================
Hits 407 407
Misses 144 144
Partials 61 61 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for that PR! |
@bubkoo interested in merging this to Webp into html-to-image? |
@jo-chemla |
Thanks for getting back with the alternatives (note the markdown links were wrongly prefixed). Current weekly downloads on npmjs / Github star counts:
|
Description
This PR implements WebP image export functionality by adding a new
toWebp
function to the library. The implementation includes:toWebp
function that converts HTML nodes to WebP imagesMotivation and Context
WebP is a modern image format that offers superior compression while maintaining good quality, making it widely adopted across the web. This PR addresses the feature request in issue #465 to add native WebP support to the library.
While users could previously work around this limitation using
toBlob
with{ type: "image/webp" }
, the new dedicatedtoWebp
function provides a more convenient and intuitive API for WebP exports, consistent with other format-specific functions in the library.Usage example:
Types of changes
Self Check before Merge