Java has a rich Image manipulation layer. The following code shows how you can scale an input BufferedImage.

Let’s step through the code. The method scale creates a new BufferedImage object with the new scaled dimensions. The following rendering hints are then set on the new BufferedImage.

These instructions tell the Image IO layer how to draw objects onto this image. The last step is to write the input image into the new output BufferedImage. This method sets the box size of the image as the desired image size. Once complete, you have an anti-aliased scaled image that can be used as needed.