Java - resize image without losing quality

前端 未结 7 1644
轮回少年
轮回少年 2020-11-29 15:48

I have 10,000 photos that need to be resized so I have a Java program to do that. Unfortunately, the quality of the image is poorly lost and I don\'t have access to the unco

7条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 16:50

    We should not forget a TwelveMonkeys Library

    It contains a really impressive filter collection.

    Usage example:

    BufferedImage input = ...; // Image to resample
    int width, height = ...; // new width/height
    
    BufferedImageOp resampler = new ResampleOp(width, height, ResampleOp.FILTER_LANCZOS);
    BufferedImage output = resampler.filter(input, null);
    

提交回复
热议问题