Search code examples
javaimageresizejpegphoto

Image resize quality (Java)


I have an open-source app which uploads photos to Facebook. To save bandwidth, the photos are automatically resized before uploading (Facebook imposes a maximum size limit). A few people have complained about the photo quality, and in fact you can see the difference (see this issue for some demo images).

So my question is, what is the "best" way of scaling down images (i.e. photos) in Java without losing quality, or at least, with minimal quality loss / artifacts?

You can see the current code I have here (resize code via this page).


Solution

  • I've tried it all - including the tricks here, and all I can say is that you're better of using ImageMagick with whatever interface. Javas imaging libraries are just not up to snuff when it comes to this. You need to support so many formats and algorithms to get it right.