Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document gray 16bits appears as black #43

Open
malaterre opened this issue Oct 20, 2023 · 7 comments
Open

Document gray 16bits appears as black #43

malaterre opened this issue Oct 20, 2023 · 7 comments

Comments

@malaterre
Copy link
Contributor

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 ?

@malaterre
Copy link
Contributor Author

Same goes for the Windows Photo Viewer:

gray16

@vbaderks
Copy link
Contributor

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.

@malaterre
Copy link
Contributor Author

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

gray16 jls

@vbaderks
Copy link
Contributor

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.

@vbaderks vbaderks reopened this Oct 22, 2023
@vbaderks
Copy link
Contributor

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.

@malaterre
Copy link
Contributor Author

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 !

@vbaderks
Copy link
Contributor

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants