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

faster image compression when alwaysKeepResolution is set to true #221

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

imtiazShakil
Copy link

When alwaysKeepResolution field is set to true, existing code tries to decrease the quality linearly.

To improve the performance in this special case, we used binary search on quality based on the notion

  • higher quality leads to larger image
  • lower quality leads to smaller image

Our target is

  • find the highest quality where the compressed image file size is lower than maxSizeMB in O(log n) time

Demo improvements:

  • added a new checkbox alwaysKeepResolution, that allows to change quality without reducing resolution
  • show the time it took to do the compression

@imtiazShakil imtiazShakil marked this pull request as ready for review August 21, 2024 16:47
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

Successfully merging this pull request may close these issues.

2 participants