java压缩后高清晰图

imgscalr – Java Image Scaling Library


java,压缩图后非常清晰
http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/



public static void main(String[] args){
try
{
BufferedImage bi=ImageIO.read(new FileInputStream("d:\\test_pic\\1.jpg"));
System.out.println("xx");
BufferedImage thumbnail=Scalr.resize(
bi,
Scalr.Method.QUALITY,
Scalr.Mode.FIT_TO_WIDTH,
300);
System.out.println("XX");
ImageIO.write(thumbnail,"jpg",new File("d:\\test_pic\\2.jpg"));

} catch (Exception e){

}
}

你可能感兴趣的:(java压缩)