`fmt: ImageFormat.WEBP` for `encodeToBytes` and `encodeToBase64` can't compress image very well
Description
Hope that fmt: ImageFormat.WEBP could reduce most size of normal png image, which couldn't.
Could you provide more information what the issue seems to be?
Could you provide more information what the issue seems to be?
For example, a .png image with a size of 3mb as input, when converted to webp by encodeToBytes, exported size will be about 2mb.
But that same png image after converted by ffmpeg with same quality will be about 100kb.
Is this a bug report or a feature request? If it is a bug, please provide me with a small reproducible example and what the expected result would be. If it is a feature request, please describe the behavior you would wish to see on this topic.
On Thu, Jul 25, 2024 at 2:09 PM gyhyfj @.***> wrote:
Could you provide more information what the issue seems to be?
For example, a .png image with a size of 3mb as input, when converted to webp by encodeToBytes, exported size will be about 2mb. But that same png image after converted by ffmpeg with same quality will be about 100kb.
— Reply to this email directly, view it on GitHub or unsubscribe. You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS or Android.
It's a feature request
const input = await Skia.Data.fromURI(
Image.resolveAssetSource(require('~/assets/test.png')).uri,
)
const image = Skia.Image.MakeImageFromEncoded(data)!
const output = image.encodeToBytes(ImageFormat.WEBP, 100)
// size of output is still large for saving and uploading,
// hope to get a much smaller size with ImageFormat.WEBP