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

[bug] Binary search doesn't end after optimal quality setting is found #132

Open
xiota opened this issue May 7, 2024 · 0 comments
Open

Comments

@xiota
Copy link

xiota commented May 7, 2024

Using the package provided by Arch Linux, the early stop code doesn't work.

/* Terminate early once bisection interval is a singleton. */
if (min == max)
attempt = 0;

$ pacman -Si jpeg-archive | grep -E '^(Repository|Name|Version|URL|Build)'
Repository      : extra
Name            : jpeg-archive
Version         : 2.2.0-3
URL             : https://github.com/danielgtaylor/jpeg-archive/
Build Date      : Fri 04 Nov 2022 05:42:19 PM UTC

$ jpeg-recompress -V
2.2.0

$ jpeg-recompress -l 15 test1.jpg t1.jpg

Metadata size is 12kb
ssim at q=67 (40 - 95): 0.999363
ssim at q=81 (68 - 95): 0.999838
ssim at q=88 (82 - 95): 0.999934
ssim at q=84 (82 - 87): 0.999897
ssim at q=86 (85 - 87): 0.999932
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
ssim at q=85 (85 - 85): 0.999898
Final optimized ssim at q=85: 0.999809
New size is 8% of original (saved 9460 kb)

$ jpeg-recompress -l 15 test2.jpg t2.jpg

Metadata size is 0kb
ssim at q=67 (40 - 95): 0.999380
ssim at q=81 (68 - 95): 0.999844
ssim at q=88 (82 - 95): 0.999935
ssim at q=84 (82 - 87): 0.999899
ssim at q=86 (85 - 87): 0.999933
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
ssim at q=85 (85 - 85): 0.999900
Final optimized ssim at q=85: 0.999818
New size is 7% of original (saved 12964 kb)

Also, what is the status of this project? I have found a few other bugs. Would pull requests with bug fixes actually be reviewed and accepted?

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