项目主页:http://code.google.com/p/java-image-scaling/
Getting Started!
Introduction
This will guide you through how to rescale images using this library.
A simple rescale
Lets say that you have a BufferedImage instance called tomato that should be rescaled to 100x200. If you want a high quality rescale, you should choose the ResampleOp class:
ResampleOp resampleOp = new ResampleOp (100,200);
BufferedImage rescaledTomato = resampleOp.filter(tomato, null);
Tip: You might need to increase your maximum heap. This can be done using the -Xmx parameter, such as: java -Xmx512m MyJavaClass
Using Unsharpen Filter
Let's improve the quality a bit more adding a unsharpen filter to the final image. This will remove some of blur, that a rescale operation creates.
ResampleOp resampleOp = new ResampleOp (100,200);
resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
BufferedImage rescaledTomato = resampleOp.filter(tomato, null);
Adding a listener
If your tomato image was very large, this might take some time. The following code add a change listener so the user can see that the computer is actually is working.
ResampleOp resampleOp = new ResampleOp (100,200);
resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
resampleOp.addProgressListener(new ProgressListener() {
public void notifyProgress(float fraction) {
System.out.printf("Still working - %f percent %n",fraction*100);
}
});
BufferedImage rescaledTomato = resampleOp.filter(tomato, null);
分享到:
相关推荐
java图片处理工具类JAR包 java-image-scalingjar
aws-java-sdk-autoscaling-1.11.277.jar
java 图像处理 图像压缩 裁剪 缩放 格式转换
java运行依赖jar包
Kang 等 - 2023 - Scaling up GANs for Text-to-Image Synthesis.pdf
A New Cross-range Scaling Algorithm Based on FrFT
time-scaling control for underactuated planar biped walkers
图片缩放工具,可以按文件夹方式递归缩放文件夹下所有图片;缩放比例可以自定义
SAR成像算法chirp-scaling
Scaling-Instagram.pdf
This special issue of Data Mining and Knowledge Discovery addresses the issue of scaling data mining algorithms, applications and systems to massive data sets by applying high performance computing ...
弹性伸缩AutoScaling-product-description-cn-zh-2018-04-24
所有的积分都属于和 在可以从存储库中安装mutter-x11-scaling和gnome-control-center-x11-scaling软件包。 要在安装运行后启用分数缩放: gsettings set org.gnome.mutter experimental-features "['x11-randr-...
Frequency-Scaling算法成像-matlab源码 Frequency-Scaling算法成像-matlab源码 【资源介绍】 SetSignalPara.m用来设置信号参数 SetImagePara.m用来设置场景参数 SetEcho.m用来产生回波 myFSA是FS算法代码 【备注】 1...
CMO Council:Scaling-the-Value-of-the-CMO
Java-Cloud-Computing-Auto-Scaling-Servers Java 中的云计算项目,可根据当前需求自动扩展正在运行的服务器的数量。 由 4 个子 Java 项目、一个负载均衡器、一个工作器、一个客户端和一个缩放器组成。
Data Algorithms: Recipes for Scaling Up with Hadoop and Spark 出版的书籍,大数据领域的圣经,最新分享
资源分类:Python库 所属语言:Python 资源全名:tencentcloud-sdk-python-autoscaling-3.0.585.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
python库。 资源全名:aws-cdk.aws-autoscaling-common-1.32.1.tar.gz
python库。 资源全名:mypy-boto3-autoscaling-plans-1.17.0.0.tar.gz