Ticket #363 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

AWTImageTools.openImage misrepresents negative pixel values for int16

Reported by: curtis Owned by: melissa
Priority: major Milestone: bio-formats-4.1
Component: bio-formats Severity: major
Keywords: Cc:
Blocked By: Blocking:


When reading an int16 BufferedImage using the AWTImageTools.openImage method, negative pixel values get represented as positive as though they are unsigned. The cause is likely related to the use of DataBuffer.USHORT rather than DataBuffer.SHORT when constructing a SignedColorModel. In addition, further testing needs to be done to verify whether int8 and int32 have similar problems.

For an example, see deltavision/curtis/AD-test-int16.dv.

Change History

comment:1 Changed 11 years ago by melissa

AWTImageTools.openImage correctly represents signed 16-bit data as of r4952. Still need to check for problems with signed 8 and 32 bit data.

comment:2 Changed 11 years ago by melissa

  • Status changed from new to closed
  • Resolution set to fixed

Signed 8-bit data (FormatTools.INT8) is not supported - see source:/trunk/components/bio-formats/src/loci/formats/AWTImageTools.java#L368 and ticket #374.

Signed 32-bit data works correctly, but unsigned 32-bit data is not supported - see source:/trunk/components/bio-formats/src/loci/formats/AWTImageTools.java#L446 and ticket #375.

Note: See TracTickets for help on using tickets.