Closed imaginator closed 10 years ago
It is currently using the ULTRA_QUALITY flag... Maybe the lib isn't able to do better than this
I did some reading on the issue. You are right - I don't think we will get a higher quality from this library.
Long-term, let's switch over to using an imagemagick-based solution. This gives us other benefits too (like creating a preview for uploaded files like PDFs etc).
Notes:
imagemagick / convert binaries can easily be installed on the server.
Pull requests for this gratefully accepted
So it looks like we want: Lanczos 3 scaling (Gimp and Photoshop use this for high quality scaling) and it is explained here: http://blog.nobel-joergensen.com/2008/12/20/downscaling-images-in-java/
Yes, it takes longer to scale the image, but we're storing the results so I'm less concerned about the CPU hit on this one.
This has some feedback too: http://stackoverflow.com/questions/14115950/quality-of-image-after-resize-very-low-java/14116909#14116909 - again they recommend Lancoz resampling.
As far as I can find, the best library right now is this one: https://code.google.com/p/java-image-scaling/
Fixed by using https://code.google.com/p/java-image-scaling/ as resizing lib
Avatars look blured.
Perhaps it makes sense to have the server generate higher quality avatars - I think I saw an option in the media library to optimise for quality over CPU use. And since we are only doing this once and then caching, it makes sense to use the highest quality setting.