-
Notifications
You must be signed in to change notification settings - Fork 242
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
Imgscalr generates blurred thumbnails #92
Comments
What I have in my head to address this is an progressive scaling algorithm. Every time an image is scaled down a step, data is lost and the scaling algorithm is in charge of estimating the result. The bigger the scale difference, the bigger the loss of data in a single operation. Right now the incremental scaling jumps down the currentDimension/7 (for ULTRA) or /2 (for anything else). This means the biggest the image is the bigger the initial jumps down are and as the image approaches it's target size (typically a thumbnail) the jumps down are smaller and smaller. A more optimal approach to incremental scaling is the exact opposite of this; the initial jumps down should be the smallest jumps losing the least amount of information and as the image gets smaller and smaller (losing more and more info) the jumps can be bigger because we have already lost the majority of info and averaged it). I have not proof-of-concepted this approach yet so I don't know the real-world impact yet, but I SUSPECT this will provide a better quality result just thinking through it. |
Just tried the same image as used by @pioterj with the latest Scalr code (commit 2fac6c4) and When using the TwelveMonkeys lanczos filter, this is the result: |
Thanks for creating and sharing this nice library. I use it on my website to generate thumbnails. I'm generally happy with thumbnail quality but I noticed that there are slightly blurred compared to images scaled down in Photoshop or Gimp. For some images it is more noticeable than others. I'm using ULTRA_QUALITY option and I couldn't find any options that would improve the quality of thumbnails further. I'm attaching an example of a thumbnail that looks much better when created in Photoshop or Gimp than in Imgscalr as well as original image.
Imgscalr:
Photoshop:
Original:
The text was updated successfully, but these errors were encountered: