This discussion is archived
1 Reply Latest reply: Apr 25, 2010 8:53 AM by 798853 RSS

Convert adobe1998RGB to sRGB

843802 Newbie
Currently Being Moderated

I'm trying to convert jpeg file with ICC_PROFILE adobe1998rgb in SRGB but the result is darker...
I try to convert with ColorConvertOp and the image is less darker but always darker than the orignal...
Anyone can help?
And Thx you!
File fileSrc = new File(source);
Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName("jpeg");
ImageReader reader =;
ImageInputStream iis = null;

iis = ImageIO.createImageInputStream(fileSrc);
reader.setInput(iis, true);
BufferedImage bi =, null);
BufferedImage dst = new BufferedImage(bi.getWidth(), bi.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
ColorConvertOp op = new ColorConvertOp(bi.getColorModel().getColorSpace(), dst.getColorModel().getColorSpace(), null);
op.filter(bi, dst);

Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName("jpeg");
JPEGImageWriter writer = (JPEGImageWriter);
File file = new File(fileName);
writer.setOutput(new FileImageOutputStream(file));
writer.write(null, new IIOImage(dst, null, null), null);
Edited by: nDija on Apr 20, 2010 8:14 AM
  • 1. Re: Convert adobe1998RGB to sRGB
    798853 Newbie
    Currently Being Moderated
      // Create an RGB color model
         int[] bits = { 8, 8, 8 };
         ColorModel colorModel = new
                              bits, false, false,