Java-好的免费库来调整图像大小 [英] Java - Good and free library to resize images

查看:49
本文介绍了Java-好的免费库来调整图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Java中调整图像大小.

I want to resize images in java.

直到现在我使用这个:

BufferedImage resizedImage = new BufferedImage((int) new_dim.getWidth(), (int) new_dim.getHeight(), type);
Graphics2D g = resizedImage.createGraphics();
g.drawImage(originalImage, 0, 0, (int) new_dim.getWidth(), (int) new_dim.getHeight(), null);
g.dispose();

其中newDim为维度.

with newDim being an Dimension.

但是结果质量很差...

But the results are very poor in quality ...

是否有一些免费的商业图书馆可以完成这项简单的工作?

Is there some commercial free library that does this simple job ?

推荐答案

您应该尝试imgscalr:

You should try out imgscalr:

https://github.com/thebuzzmedia/imgscalr

http://www.htmlgoodies.com/beyond/java/create-high-quality-thumbnails-using-the-imgscalr-library.html

这篇关于Java-好的免费库来调整图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆