Posted By:
Lubos_Dolezel
Posted On:
Tuesday, November 20, 2007 04:33 PM
Hello, I have a problem using ImageIO.write() to generate JPEG images. Whenever I try to create one, the resulting image has very weird colours - and it really doesn't seem to be caused just by compression. The interesting thing is that the web browser may not even be able to display it. See an example code: public class ImageTest { public static void main(String[] args) throws Exception { File imageFile = new File(args[0]); File imageOut = new File(args[1]); ImageIO.write(ImageIO.read(imageFile), "jpeg", imageOut); } } See the sample source image: http://www.dolezel.info/tmp/bug/fatrat_bt.png And the resulting file:
More>>
Hello,
I have a problem using ImageIO.write() to generate JPEG images. Whenever I try to create one, the resulting image has very weird colours - and it really doesn't seem to be caused just by compression. The interesting thing is that the web browser may not even be able to display it. See an example code:
public class ImageTest {
public static void main(String[] args) throws Exception {
File imageFile = new File(args[0]);
File imageOut = new File(args[1]);
ImageIO.write(ImageIO.read(imageFile), "jpeg", imageOut);
}
}
See the sample source image: http://www.dolezel.info/tmp/bug/fatrat_bt.png
And the resulting file: http://www.dolezel.info/tmp/bug/fatrat_bt.jpg
I am using Java 1.6.0_03 64bit. Do you have any ideas what could be wrong?
<<Less