import java.awt.image.BufferedImage; abstract class PhotoTransform{ PixelTransform tr; double scale; public BufferedImage transform( BufferedImage image ){ int width = (int) Math.round(image.getWidth() * scale); int height = (int) Math.round(image.getHeight() * scale); BufferedImage newImage = new BufferedImage(width,height, BufferedImage.TYPE_INT_RGB); tr.init(image); for(int i = 0; i < width; i++) { for(int j = 0; j < height; j++) { newImage.setRGB(i, j, tr.getPixel( i, j )); } } return newImage; } }