Data AccessCore JavaApp FrameworksViewTestingBuildingDeploymentDev ToolsSecurityOpinions

Monday, December 29, 2008

javax.imageio.ImageIO and degrading JPEG

JPEG is a lossy compression encoding algorithm. Each time you encode a JPEG image, you lose image quality because of the cosine coefficients dropped in order to perform the compression.

Using the read and write methods from and javax.imageio.ImageIO.write method will amplify this quality loss, because of varying detail levels during the read and write. You may be reading a jpeg and 90% detail and writing it with 50% detail.

Avoid jpeg interpretation of image files unless image processing is required.