title: Add Tiff Image Color Profile (sRGB or Adobe 1998) with Java
body: <p>I searched the web high and low and I can't find a solution for how to add a sRGB or Abobe (1998) color profile to a Tiff Image with Java. There's some examples out there for jpgs and pngs, but they don't apply to tiffs. I have been trying to do it with Commons Imaging and java.awt but not having any luck. Is it possible?</p>
  
  <p>Thanks</p>
  
  <p>Update:</p>
  
  <p>I've made some progress using the TwelveMonkeys imageio-tiff library and the following code:</p>
  
  <pre><code>File file = new File("/Users/user/Desktop/demo/sandal.tif");
  BufferedImage image = ImageIO.read(file);
  
  ICC_Profile ip = ICC_Profile.getInstance("/Users/user/Documents/icc/AdobeRGB1998.icc");
  ICC_ColorSpace ics = new ICC_ColorSpace( ip );
  ColorConvertOp cco = new ColorConvertOp( ics, null );
  BufferedImage result = cco.filter(image, null);
  
  ImageIO.write(result, "TIFF", new File("/Users/user/Desktop/demo/sandal2.tif"));
  </code></pre>
  
  <p>The color profile is applied, but the tiff is flattened and the alpha removed. How can the alpha channel be preserved?</p>