I would like a high-quality way to scale images, in particular JPEG images, using Java. I looked into this extensively around 2007, and at the time JAI had problems that would produce black borders in some scaled images.
Back then I finally settled on a technique of using Image.getScaledInstance()
and writing to a BufferedImage
with Graphics2D
rendering hints, modified from a technique described by Perry Nguyen. This approach was slower, but produced images virtually identical in quality to JAI subsample average, but without the incorrect borders.
In revisiting this I did some quick research, but I don't see that there is any better way to do this than there was almost 15 years ago. However I did find Apache Commons Imaging, a new project that claims to only use Java, so it promising. Unfortunately I couldn't find any documentation on scaling images.
Does Apache Common Imaging handle high-quality scaling of images? If so, where can I find documentation?