I use the following line for writing Image files:
/**Saves the specified image to file.
* @param image the Image to save
* @param extension the extension of the file type to write
* @param file the file to write to
*/
ImageIO.write(image, extension, file);
If the extension is png, it works fine. If the extension is jpg, the file is discolored. I realize that jpeg is a lossy format, but the resulting files are ridiculously discolored. Is this a bug in ImageIO, or do I need to do something special?
I’m using version 1.5 update 9.