If you try to write a BufferedImage on disk using ImageIO.write you will see that the result image will have a DPI of 96 regardless of the source image's DPI!
In order to keep the source DPI or set your own DPI you need to write your image using JPEGImageEncoder class.
In order to keep the source DPI or set your own DPI you need to write your image using JPEGImageEncoder class.