Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.0-alpha3
-
None
-
Tested with Java 1.8.0_281 on Windows 10 Professional
Description
Hi. I am reading JPEG image file and using this library to convert it to BMP format. Resultant bitmap file has wrong color comparing to original file. Below is the code :
ArrayList<File> files = new ArrayList<File>(); files.add(new File("./files/25606_200x200.jpg")); files.add(new File("./files/91691-01.jpg")); for (File file : files) { try { //File trgFile = ImageConverter.convert(file, "bmp"); final BufferedImage bi = Imaging.getBufferedImage(file); final File dstFile = new File(file .getAbsolutePath() + ".bmp"); Imaging.writeImage(bi, dstFile, ImageFormats.BMP); System.out.println(dstFile.getName() + " has been converted successfully."); } catch (Exception e) { e.printStackTrace(); } }
Image "25606_200x200.jpg.bmp" has the wrong color depth, image "91691-01.jpg.bmp" has the right color depth but wrong color mapping (maybe the embedded ICC-Profile is the cause here).