-2
我想尝试缩放图像最多3次。图像调整UpScale丢失质量
例如,
最多缩放图像
我用这library的图像缩放。
剪断下面的代码做的伎俩,
public static BufferedImage getScaledSampledImage(BufferedImage img,
int targetWidth, int targetHeight, boolean higherQuality) {
ResampleOp resampleOp = new ResampleOp(targetWidth, targetHeight);
resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
BufferedImage rescaledImage = resampleOp.filter(img, null);
return rescaledImage;
}
你可以看到有一个缩放后的图像质量较低。我希望我可以放大图像比原始图像至少3倍,而不会丢失质量。
它是否可以使用?我是否需要改变现有的图书馆?
感谢
没有涉及“图像丢失”。没有图像质量的大小开始。这是纯粹的光学,与代码无关。最好的解决方案是使用最大可能的原始图像开始。 –
可能的重复[如何在java中放大图像而不会丢失质量?](http://stackoverflow.com/questions/9281385/how-might-i-enlarge-image-in-java-without-losing-quality) –