title: BufferedImage reduces Image size
body: <p>I was using java ImageIO and BufferedImage for some image operations and wanted to see how it behaves when I output the image as a jpg. There I found some interesting behaviour that I can't quite explain. I have the following code. The code reads an image and then outputs the same image as "copy.jpg" in the same folder. The code is in Kotlin, but the functions used are java functions:</p>
  
  <pre><code>val image = File("some/image/path.jpg")
  val bufImage = ImageIO.read(image.inputStream())
  FileOutputStream(File(image.parentFile, "copy.jpg")).use { os -&gt;
      ImageIO.write(bufImage, "jpg", os)
  }
  </code></pre>
  
  <p>I would expect it to output the exactly same file, except maybe the meta information. However the resulting file was almost a tenth of the original file. I doubt the meta information would be that much. The exact size difference varied depending on which image file I used, however every time the output image would be smaller. But I could not see a quality difference to the old file. When zooming in I would see the same pixels. </p>
  
  <p><strong>Why is the file size reduced so dramatically?</strong></p>