team-charls / jpegls-wic-codec

Windows Imaging Component (WIC) codec for JPEG-LS .jls files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document gray 16bits appears as black

malaterre opened this issue · comments

From the main README it appears as if a 16bits would be displayed (at least low bits). On my system it is displayed as black:

screenshot

Would it be possible to clarify the toplevel README ?

Same goes for the Windows Photo Viewer:

gray16

The 16-bit test images I have are displayed correctly with Windows Photo Viewer on Windows 11.

Can you attach the gray16.jls image to this issue. I can then check if I can reproduce the problem.

Here you go. I can decompress it just fine using either GDCM and/or DCMTK. Thanks !

gray16 jls

The image will decompress fine. It's range is however very small: [0..1176]. The Windows display pipeline expects 16 bit grayscale images to use the full 16 bit range (0 .. 65535). In essence it will only use the 8 high bits of a 16 bits images.
This causes Windows Photo Viewer to show a black rectangle.

Normally DICOM viewing software will compensate for this and use additional info from the .dcm file (display LUT, etc) to map the used grayscale values to the 256 values a normal RGB monitor can display.

I have extended the WIC Explore application, an application I normally use for testing, to have an option to normalize the histogram of the image and use the full range.

The primary purpose of a WIC codec is to decode the pixels and to create a WICBitmapSource object. The viewer is responsible for displaying the bitmap on the screen.

Normalization of 16 bit grayscale images could also be built into the codec. This would be a global setting, as there is no API for it. But it would allow standard Windows viewers (Photo viewer and the thumbnail generator ) to be able to generate "visible" images.

It's range is however very small: [0..1176].

Thanks for catching my misunderstanding Victor !

Maybe a bit off-topic, but is there any reason why you are not distributing the windows binaries of the wic* related projects ? WICExplorer seems to require a recent VS, so distributing the binaries would reach a wide audience.

Thanks !

  • Good feedback. The plan is to release the binaries. I didn't have time to finish the installer yet.
  • I found out that there is an additional interface that a WICBitmapSource object could provide to assist in converting from 1 colorspace to another. The plan is to see if this could help to properly display 16-bit grayscale images in Windows Photo and in explorer thumbnails.