Java ImageIO for JPG - What is the standard compression?
I'm curious and would like to understand what the standard compression for JPG's in Java is, and what people think about it.
BACKGROUND:
A while back I wrote myself a Java tool that helps me automatically resize JPG files. The commands for saving a JPG-file lead back to the following package
- package javax.imageio and javax.imageio.ImageIO
The call to save a file calls "ImageIO.write(image, "jpg", filename)
MY CURRENT USE:
I have now adapted the code for a small project at work. We have 16.000 JPG files on the network accumulated over the last 15 years. That makes for 25GB of server space, which we need. These are mostly technical photos of bearings, damaged parts, poor lighting, etc. Etc - and only a few good looking high resolution amateur photos --- but no professional images.
I have found that if I run photos through my program, I can get amazing reductions in the size without any change to the photo resolution. Anything between 40 and 80% size reduction is expected.
For example, the service department are 6,5MB photos with their iphones --- and my Java program automatically converts them to ca. 1MB. It is _very_ difficult to visually distinguish between the two resulting JPG files! Only by looking closely at individual pixels can I spot minor differences.
MY QUESTIONS
-How much compression does imageIO use as a standard? Is it considered "good" or "bad" - above or below average?
-Does Java perhaps just have superior compression technique than an iPhone has (and most "common" digital cameras over the last 15 years?)
- Is my 80% reduction in a 3200pixel photo just due to "quality" loss -- or is it perhaps just a better jpg compression method?
-Are there any opinions about the ImageIO having a good or bad standard setting?
The program is currently munching away on our servers this evening --- clearing a bunch of free space. But I would be curious to better understand what is happening.
Looking forward to any input.