Resized image degrades in quality.

Posted by Venkats on Stack Overflow See other posts from Stack Overflow or by Venkats
Published on 2010-03-06T05:21:23Z Indexed on 2010/05/08 9:28 UTC
Read the original article Hit count: 299

I resized an image using Java2D Graphics class. But it doesn't look right.

    BufferedImage resizedImage = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, type);
    Graphics2D g = resizedImage.createGraphics();
    g.drawImage(originalImage, 0, 0, IMG_WIDTH, IMG_HEIGHT, null);
    g.dispose();

Is it possible to scale an image without introducing artifacts?

© Stack Overflow or respective owner

Related posts about java

Related posts about graphics