I have a jpeg image that contains an ICC Profile of Nikon sRGB 4.0.0.3001.
I want to read this image in, perform some JAI operations, and write the
new image out. For some reason, reading the file in and writing it back
out using the ImageIO read and write methods is causing images with this
ICC Profile tag to become significantly darker, where you almost can't
tell what the image even is. If I use Photoshop to remove the ICC Profile
information from my jpeg before running it through this code, the
outputted image looks just fine. Am I doing something wrong? Are there
some kind of colorspace hints or other types of hints I could provide to
the JPEG codec to avoid this problem? The code needs to be able to handle
jpegs both with and without this ICC Profile tag.
Here is the simple code I am running:
public class ImageTester {
public static void main(String args[]) {
if(args.length < 2) {
System.out.println("Usage: ImageTester <source_file>
<dest_file>");
System.exit(0);
}
try {
FileInputStream fis = new FileInputStream(args[0]);
BufferedImage bImage = ImageIO.read(new FileInputStream(args
[0]));
/* Do some JAI stuff here when I get the ImageIO code to work
*/
FileOutputStream fos = new FileOutputStream(args[1]);
ImageIO.write(bImage, "JPEG", fos);
fis.close();
fos.close();
}
catch(IOException ex) {
ex.printStackTrace();
}
}
}
I can email anyone who is interested my JPEG test images, one with the ICC
Profile and the one where I have removed it.
Thanks,
Julie
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".