private static final StdImage rotate(StdImage image, int angle) {
		int width = image.getWidth();
		int height = image.getHeight();
		StdImage buffer = createTransparent(height, width);
		Graphics2D gc = buffer.getGraphics();
		gc.rotate(Math.toRadians(angle));
		int x;
		int y;
		if (angle == 90) {
			x = 0;
			y = -width;
		} else if (angle == 180) {
			x = -width;
			y = -height;
		} else if (angle == 270) {
			x = -height;
			y = 0;
		} else {
			x = 0;
			y = 0;
			Log.error(String.format(INVALID_ANGLE, Integer.valueOf(angle)));
		}
		gc.drawImage(image, x, y, null);
		gc.dispose();
		return buffer;
	}