-
Notifications
You must be signed in to change notification settings - Fork 90
Converting a UIImage to the WebP format is extremely slow #115
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
Comments
Image encoding takes more time than JPEG, it's a by-design behavior. You can upgrade libwebp version instead, or more We can added something like |
|
You can have a try. But anyway, maybe provide some detailed control options like the Google official CLI tool is a https://developers.google.com/speed/webp/docs/cwebp
I can have a check whether it's suitable and easy to implements. Recently I provided the similar encoding options on libjxl codec (in https://github.com/SDWebImage/SDWebImageJPEGXLCoder?tab=readme-ov-file#advanced-jxl-codec-options) |
Converting a UIImage to the WebP format is extremely slow. For a 2.5-megabyte photo with a compression ratio of 0.85, it takes approximately 13.5 seconds
let webpCoder = SDImageWebPCoder.shared
var options: [SDImageCoderOption: Any] = [:]
options[SDImageCoderOption.encodeCompressionQuality] = 0.85
if let webpData = webpCoder.encodedData(with: image, format: .webP, options: options) {
compressionImageData = webpData
}
The text was updated successfully, but these errors were encountered: