Daniel Warren Daniel is a Java Developer at IDRsolutions. He enjoys experimenting with different computer systems, cycling, and a variety of PC games.

Using super-resolution imaging to improve scaling

1 min read

The basic idea of super-resolution imaging is the ability to scale up images and maintain visual quality either for people to view or for computer image analysis.

Super-resolution is important due to the diffraction limit, the limit on the resolution an optical hardware can reach due to the diffraction of light. The ability to improve the resolution via an algorithm means that you can subvert that limit to increase the resolution.

So why talk about super-resolution scaling? Besides it being a pretty cool topic, our Java imaging SDK JDeli added support for Super Resolution and you might find that it is what you need to get those high quality images.

So let’s run a little experiment. Let’s take this image of some zebras and run it through JDeli’s super-resolution scaling and Java’s bicubic scaling.

Here is the initial image:

For JDeli super-resolution I am using the following code:

BufferedImage image = JDeli.read(new File("Zebras.png"));
image = SuperResolution.scale2x(image);
JDeli.write(image, JDeli.OutputFormat.PNG, new File("Zebras-JDeli-Scaled.png"));

For Java bicubic I am using the following code:

BufferedImage src = JDeli.read(new File("Zebras.png"));
final int w = src.getWidth();
final int h = src.getHeight();
BufferedImage dst = new BufferedImage((w * 2),(h * 2), BufferedImage.TYPE_INT_ARGB);
final AffineTransform at = AffineTransform.getScaleInstance(2.0, 2.0);
final AffineTransformOp ato = new AffineTransformOp(at, AffineTransformOp.TYPE_BICUBIC);
dst = ato.filter(src, dst);
JDeli.write(dst, JDeli.OutputFormat.PNG, new File("Zebras-Java-Scaled.png"));

End result side by side comparison: (please click on the images to see the difference)

JDeli super-resolutionJava bicubic

As you can see, super-resolution maintains the quality of the initial image, whereas bicubic ends up in a more blurred image. At IDRsolutions, we’re very happy with the results that you get with JDeli. What do you think?

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Daniel Warren Daniel is a Java Developer at IDRsolutions. He enjoys experimenting with different computer systems, cycling, and a variety of PC games.

How to choose JPG versus JPEG2000 for image files

Since we started to support both JPG and JPG2000 as image file outputs in our software, we have found that this is a very...
Mark Stephens
1 min read

One Reply to “Using super-resolution imaging to improve scaling”

  1. Definitely an improvement over Java Bicubic in terms of clarity. To my eye it looks like the zebra in the forefront and the zebra in the background on the right have had their rumps over-enhanced in terms of colour and it looks artificial.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.