Hugo Saves the Day for Java Image Resizing
Many thanks owed to Hugo over at Component House for his article on High-Quality Image Resize with Java. Since creating ByFolio, I've been unsettled about the quality of the smaller thumbnails created for the main showcase page. Particularly, text looked absolutely abysmal.
Here's an example of the medium size thumbnail generated from this original image:
Yuck, yuck, yuck. This atrocity was accomplished with a simple AffineTransform operation in Java to scale down from 525px x 525px to 275px x 275px. I had previously played around with setting aliasing values during the scale operation, but did not get significant improvements. As an added bonus, that black line along the right-hand side of the image is an artifact of the scaling operation when done incorrectly. All in all, I was left pretty disappointed by the results, but was forced to move on.
Hugo's article filled in the missing piece of the puzzle: blur the image, then do the resize! Here's the result:
Much better! I also took the opportunity to fix the black-line bug, and wrote a quick script to go back and fix all of the folio images that were already created. There's still room for improvement, but I can now table this until I have the time to go back and write a more universal image processor that can handle formats other than JPEGs.
Thanks Hugo!
Posted at 05:59PM Mar 31, 2008 by Cory in Development | Comments[1]


You should also try the getScaledInstance() method, which was the main point of discussion on my blog (see comments at the bottom of my article).
Regards,
Hugo Teixeira
Posted by Hugo Teixeira on March 31, 2008 at 06:52 PM EDT #