Hi,
Wondering, if someone else knows/can help?
I am looking for a way to use a custom palette with 16-bit grayscale image data. I am looking to remap the pixels for display only (so can see normally image features that are too dark). I want to use the palette to avoid looping through all of the millions of pixels in the image (which does not meet my performance desires).
This code displays the 16-bit grayscale image correctly.
It seems to ignore a new custom palette (not in above code) unless I make the
Thanks for looking!
Wondering, if someone else knows/can help?
I am looking for a way to use a custom palette with 16-bit grayscale image data. I am looking to remap the pixels for display only (so can see normally image features that are too dark). I want to use the palette to avoid looping through all of the millions of pixels in the image (which does not meet my performance desires).
This code displays the 16-bit grayscale image correctly.
PixelFormat pf = PixelFormats.Gray16; //int rawStride = ((width * pf.BitsPerPixel) + 7) / 8; // Create a BitmapSource. BitmapPalette palette = BitmapPalettes.Gray16; BitmapSource bitmap = BitmapSource.Create( width, height,96, // 96 is dpi for X and Y96, pf, palette, pixelData, rawStride); return bitmap;
It seems to ignore a new custom palette (not in above code) unless I make the
PixelFormat pf = PixelFormats.Indexed<4|8>but I do not see a PixelFormats.Indexed16 for 16-bit support.
Thanks for looking!