double Ratio=1.0;
...
BufferedImage Itemp;
// Because you use AffineTransformOp to do transform
// Image Itemp = Bi.getScaledInstance(200, 200, Bi.SCALE_SMOOTH);
ImageIO.write(Itemp, formatName, outputFile); //no cast
jpg is a losing format. to improve quality, you can use .png format.
another thing is ImageIo.write doesn't support .gif