Format16bppGrayScale not supported

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After searching newsgroups and discussions, i came to the following conclusion.
Even though PixelFormat.Format16bppGrayScale is defined, it's NOT and will
NEVER
be supported by the .NET framework.
For our business (medical imaging), this is very disappointing.
16 bit gray is most common imageformat used for medical imaging.
Scaling back to 8 bit is not an option. We really need 16 bit accuracy
in our processing operations.
Does this mean that .NET is not meant for professional imaging?
Please reconsider support for 16 bit gray.

Thanks,
Jos Lavrijsen (Philips Medical Systems)
 
Unfortunately you're unlikely to see this resolved by MS in the short term.
However you may be interested in the FreeImage library on SourceForge which
has a C# wrapper and supports lots of image formats.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
You should really post your request here:

http://lab.msdn.microsoft.com/productfeedback/Default.aspx

While some Microsoft people do read this newsgroup, MS makes no
guarantees that every post will be read or that a post will receive an
official reaction. The Product Feedback page on MSDN is a different
matter altogether.

I don't know about 16 bit grayscale in particular, but I do know that
..NET's graphics support is sadly lacking, and that the MS team knows
that... it's just not going to be improved much for Whidbey (.NET v2.0,
2005). The last I heard was, "Maybe Longhorn."
 
I am also trying to display 16bpp grayscale images. What is the right
way to convert them into RGB format? I devided each pixel value by 3
and assign the result to R/G/B. But the resultant images have lost
contrast almost completely. Any pointers are appreciated!
 
This might help.

/// <summary>Convert 16 bit gray to RGB</summary>
/// <param name="grayPixels">source pixels</param>
/// <param name="bitsStored">bits used [1..16]</param>
/// <returns>rgb pixels</returns>
public uint[] ConvertGray16ToRGB(ushort[] grayPixels, int bitsUsed) {
int pixelCount = grayPixels.Length;
uint[] rgbPixels = new uint[pixelCount];
int shift = bitsUsed - 8;
for (int i = 0; i < pixelCount; i++) {
uint gray = (uint)grayPixels >> shift;
rgbPixels = 0xff000000U | gray | (gray << 8) | (gray <<
16);
}
return(rgbPixels);
}


Success,
Jos Lavrijsen
 
Back
Top