title: JAI FormatDescriptor image becomes white
body: <p>I want to do an overlay operation with two images. The number of bands and the data type of these images need to be the same, so I can perform the overlay operation. Therefore I'm using a <code>FormatDescriptor</code> to change the data type of one image to that of the other. But now the image is all white.</p>
  
  <p>Is that normal? Or do I have an error in the <code>FormatDescriptor</code>?</p>
  
  <p>Below is the code for the reformatting:</p>
  
  <blockquote>
  <pre><code>RenderedImage finalImage = loadTiles(i, columns, rows);           
  // Format Image so that the data type matches that of the overlay
  finalImage = FormatDescriptor.create(finalImage, overlay.getSampleModel().getDataType(), null);
  images.add(finalImage); 
  columns = roundUp(columns, 2); 
  rows = roundUp(rows, 2);
  </code></pre>
  </blockquote>
  
  <p>Thank you for your help.</p>
  
  <p><strong>EDIT</strong> I tried formatting the overlay so it matches the data type of the image. That way the image is displayed correctly, but the overlay is completly black.</p>
  
  <p>The normal data types are as follows:</p>
  
  <p>image: data type = 1 (ushort)</p>
  
  <p>overlay: data type = 0 (byte)</p>
  
  <p><strong>EDIT</strong> I also tried reformatting the image to every other data type. And everytime I got the same result. The image was all white. Except when I tried formatting to short. Then I got <code>NullPointerException</code>. </p>
  
  <p>I have no idea, what I'm doing wrong. I have found many different examples of using the Format Operation and I used it the same way. But when I get a white image when reformatting, what is the point of using the Format Operation? Is there another way to change the data type of the image, so it matches that of the overlay?</p>