Here you can find the source of verticalFlip(BufferedImage img)
public static BufferedImage verticalFlip(BufferedImage img)
//package com.java2s; //License from project: Open Source License import java.awt.Graphics2D; import java.awt.image.BufferedImage; public class Main { public static BufferedImage verticalFlip(BufferedImage img) { int w = img.getWidth(); int h = img.getHeight(); BufferedImage flippedImage = new BufferedImage(w, h, img .getColorModel().getTransparency()); Graphics2D g = flippedImage.createGraphics(); g.drawImage(img, 0, 0, w, h, 0, h, w, 0, null); g.dispose();//from w w w.j a v a 2 s . co m return flippedImage; } }