I try to save a picture by using the class ImageIO, but I have found a problem that the size of the picture will small. The code is like this:
public class SeamCarving {
static String path="C:/Users/lenovo/Desktop/h4/01.jpg";
public static void main(String[] args)throws Exception {
File file1=new File(path);
System.out.println(file1.length());
BufferedImage image=ImageIO.read(file1);
File file2=new File("d:/02.jpg");
ImageIO.write(image, "jpg",file2);
image.flush();
System.out.println(file2.length());
}
}
After the operation, I found the size is 4788268 and 1529534. So I can't understand why the size of the picture is small.