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

Set quality slider by specifying a target file size. #1422

Open
barryhunter opened this issue Jul 9, 2024 · 3 comments
Open

Set quality slider by specifying a target file size. #1422

barryhunter opened this issue Jul 9, 2024 · 3 comments

Comments

@barryhunter
Copy link

Is your feature request related to a problem? Please describe.
The 'quality' slider isn't comparable between different formats. So hard to compare how well each format performs for comparable file sizes.

Describe the solution you'd like

Would be really nice to set a target size percentage, like 30% of the original filesize. (and/or a target file size like 100kb)

And it will find the right 'quality' setting for the given format. I imagine it as some sort of binary search, testing different quality settings, until reach the target.
So can see what sort of quality each type of format gives, for a given file size.

Additional context
Can be done manually, but the 'trial and error' process of setting the slider could be automated. Probably just focus on the quality slider.

Would be really cool if could see it 'animate' setting the quality slider as it hunts, but not required. Ie see the slider jump around, and quality of the image jump around.

Of course if even setting the slider to either extreme can't reach the target, should say so :)

@gargantuadev
Copy link

gargantuadev commented Sep 2, 2024

Hi there,

I'm interested in taking on this task—this would be my first one! However, I'm new to Squoosh and want to make sure I've understood the task correctly.

From what I gather, you would like to select a format, such as "Browser JPEG," and then automatically adjust the quality slider so that the percentage in the light blue corner meets a specified target level. Alternatively, the slider should be adjusted to ensure the file size is below a certain target size.

Is that correct?

image

Thank you for your help! :)

@barryhunter
Copy link
Author

I dont know why I didnt see this before. (just revisited sqoosh repo again for something else)

What I mean is would a 'slider' for the 'filesize target'. It could be a 'absolute' target like 100kb, or just a relative to input. Eg set to 50% of input image file size.

And they the app would try to find the 'quality' setting that gives that file size. The resultant quality level would be different with every encoder.

In your example, would 'set' that want 75% file size reduction, and it would figure out that need to set quality to 0.48 :)

(ie rather than setting quality, and find out how bit the file is. Instead set the file size, and find out what quality setting is needed)

I think this would give better comparison between encoders. Eg could target say 75% file size reduction, and see how low quality each encoder has to go! Better encoders would keep the quality higher.

@gargantuadev
Copy link

gargantuadev commented Oct 21, 2024

Super interesting!
Don't worry about the missed message, I'm down for it. I will provide a PR, I'll let you know as soon is ready!

Anyway, I noticed that on github they don't highlight notification, this is a bit weird, only emails keep me updated on this platform ahahah.

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

2 participants