1 Reply Latest reply on Apr 25, 2010 3:53 PM by MSC

    Convert adobe1998RGB to sRGB


      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 = readers.next();
      ImageInputStream iis = null;
      iis = ImageIO.createImageInputStream(fileSrc);
      reader.setInput(iis, true);
      BufferedImage bi = reader.read(0, 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) writers.next();
      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
            // Create an RGB color model
               int[] bits = { 8, 8, 8 };
               ColorModel colorModel = new
                                    bits, false, false,