이미지를 회전시키는 데이 기능이 있습니다. 품질이 나 빠졌지 만 개선 할 수있는 변경 사항이 있습니까?자바 회전 이미지 품질 저하
public BufferedImage RotateImage(String imagePath,int degrees) throws IOException{
File file = new File(imagePath);
Image image = ImageIO.read(file);
BufferedImage img=bufferImage(image, BufferedImage.TYPE_INT_RGB);
AffineTransform tx = new AffineTransform();
double radians = (Math.PI/180) * degrees;
double width = img.getWidth()/2;
double height = img.getHeight()/2;
if(degrees != 180){
tx.translate(height,width);
tx.rotate(radians);
tx.translate(-width,-height);
}else{
tx.rotate(radians,width, height);
}
AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
img = op.filter(img, null);
return img;
}
[SSCCE] (http://pscode.org/sscce.html)를 게시 한 경우 ** 우리는 ** 다른 크기 조정 기술을 시도 할 수 있습니다. 이미지가 포함 된 SSCCE의 경우 코드에서 직접 생성하거나 네트워크에서 직접 이미지로 바로 링크합니다 (예 : 내 [미디어 페이지] (http://pscode.org/media/#image)에서 사용할 수있는 이미지 중 하나입니다. –