converting bmp to jpg in java

bmp, java, jpeg

Solution

Yes you will. Actually regardless of the way to convert a BMP (lossless) to JPG (lossy) you always lose quality. You can limit the damage if you set the JPG quality to 100% (which kind of defeats the purpose in my opinion).

Use this tutorial to fix it.

Problem

How do you convert bmp to jpg in Java? I know how to use the `ImageIO` way but is there a much faster or better way of doing it? This is the ImageIO way of doing that I found on the web. ``` `//Create file for the source File input = new File("c:/temp/image.bmp"); //Read the file to a BufferedImage BufferedImage image = ImageIO.read(input);` //Create a file for the output File output = new File("c:/temp/image.jpg"); //Write the image to the destination as a JPG ImageIO.write(image, "jpg", output); ``` If I use this way will I lose quality? Thanks

Original source