JDK-6294984 : Output img looks distorted when writing USHORT_555_RGB using BMPWriter with BI_BITFIELDS compression
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.imageio
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2005-07-08
  • Updated: 2011-01-19
  • Resolved: 2005-09-27
Related Reports
Duplicate :  
Description
I am writing a buffered image of type USHORT_555_RGB to a file using BMP Writer. I have set the compression type to BI_BITFILEDS. Once the image is written, I am reading back the same image using BMP ImageReader. The image looks completely distorted. I tried opening the output image using some native apps and the image looks the same. I have attached a screenshot of the image. 

This is reproducible since Tiger-FCS on all platforms. 

I have attached a sample test. Execute the sample test. Check the third image that is getting loaded. It will be distorted.
###@###.### 2005-07-08 13:42:30 GMT

Comments
EVALUATION This problem was caused by using only 565 mask in case of 16bpp images with BI_BITFIELDS compression. However, according to MSDN description the 555 mask is also legal in case of BI_BITFIELDS compression of BMP and we shoud use it to write corresponding images.
26-09-2005