storing transformed BufferedImage in Java <p>In Java, instead of using photoshop to transform my images(that I use in the program), I want to use code to transform and save them.</p> <p>I have created an AffineTransform object "at" and called the <code>rotate()</code> method. I have a BufferedImage called "image". </p> <p>I can draw the image on the screen with the desired transformation with this code:</p> <pre><code>g2d.drawImage(image, at, null); </code></pre> <p>What I want to do is to store the combination of at and image in a new BufferedImage image2. How can I do this so that<code>g2d.drawImage(image2,50,50, null);</code> will show the rotated version of image?</p> <p>edit: I've tweaked Ezequiel's answer a bit to get the effect I wanted. This did the trick:</p> <pre><code>BufferedImage image2= null; AffineTransformOp affineTransformOp = new AffineTransformOp(at,AffineTransformOp.TYPE_BILINEAR); image2 = affineTransformOp.filter(image, image2); g2d.drawImage(image2, 50, 50, null); </code></pre>