title: How to convert between color models
body: <p>I am very new to image processing. I have a PNG image (read using <code>ImageIO.read()</code>) that yields <code>BufferedImage.TYPE_CUSTOM</code> when I call <code>getType()</code> on it.</p>
  
  <pre><code>BufferedImage bi = ImageIO.read(new URL("file:/C:/samp1.png"));
  int type =bi.getType(); //TYPE_CUSTOM for samp1.png
  </code></pre>
  
  <p>Now I would like to convert it to one of the following models:</p>
  
  <ol>
  <li>TYPE_USHORT_GRAY </li>
  <li>TYPE_3BYTE_BGR</li>
  <li>TYPE_BYTE_GRAY</li>
  <li>TYPE_INT_RGB</li>
  <li>TYPE_INT_ARGB</li>
  </ol>
  
  <p>The above needs to be done to process the image further using a library that recognises only the above types. </p>
  
  <p>How do I convert from <code>TYPE_CUSTOM</code> color model to other models?</p>
  
  <p>Any help/pointers would be much appreciated.
  If there aren't any existing library to do this, any link/post to steps/algorithm would be great.</p>