Skip to content

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