Skip to content
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

Bad compression ratio for PNG images #847

Open
mipastgt opened this issue Dec 15, 2023 · 0 comments
Open

Bad compression ratio for PNG images #847

mipastgt opened this issue Dec 15, 2023 · 0 comments

Comments

@mipastgt
Copy link

Skia can encode images into a ByteArray. I noticed however that doing that for PNG images results in much larger images than usual. Something seems to be wrong with the compression. Attached please find a full project to reproduce this issue. The original image is already a PNG with a size of 870_254 bytes. After reading that in and storing again as PNG image its size becomes a whopping 1_291_525 bytes. There must be something wrong with the compression or its settings. Playing with the quality setting only makes things even worse.

Tested on
macOS Sonoma 14.1.2
kotlin.version=1.9.21
agp.version=8.1.4
compose.version=1.6.0-dev1334

PNGSizeDemo.zip

@mipastgt mipastgt changed the title Bad compression ration for PNG images Bad compression ratio for PNG images Dec 15, 2023
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

No branches or pull requests

1 participant