Grayscale display problems in PC/Windows

Lawrence H. Robins (mailto:lrobins@ENH.NIST.GOV)
Tue, 9 Apr 1996 17:50:46 -0400

Message-Id: <mailto:199604092156.QAA00825@library.wustl.edu>
Date:         Tue, 9 Apr 1996 17:50:46 -0400
From: "Lawrence H. Robins" <mailto:lrobins@ENH.NIST.GOV>
Subject:      Grayscale display problems in PC/Windows
To: Multiple recipients of list IMAGELIB

[This is my first message to ImageLib.
 A colleague at the National Institute of Standards and
 Technology suggested that I send my inquiry here after
 I posted to one of our (NIST) internal newsgroups.
 I have also sent this message to a "broad spectrum"
 of graphics-related newsgroups:
   comp.graphics.apps.photoshop
   comp.graphics.misc
   comp.os.ms-windows.programmer.graphics
   comp.os.ms-windows.video
   comp.sys.ibm.pc.hardware.video
   comp.sys.mac.graphics
   comp.sys.mac.hardware.video
]

I'm having a problem with displaying high-quality 8-bit grayscale (256 shades of gray) images on the monitor of my Pentium PC, running MS-Windows 3.1, with a Diamond Stealth 32 PCI graphics board with 2 MB of DRAM. I think this problem is intrinsic to the video graphics systems (board + driver software) on most PC-Windows machines. In other words, I don't think an applications programmer could solve the problem except by writing a new device driver for the graphics board. I will try to describe the problem as precisely as possible.

When I noticed that grayscale images (micrographs) "didn't look quite right" I generated some test images to examine the problem more carefully, in Windows Bitmap (*.BMP) or TIFF (*.TIF) format - specific file format doesn't matter.

IMAGE 1: 256 rectangles, each 40*30 pixels, with gray levels from 0, BLACK to 255, WHITE, arranged in a checkerboard pattern. "8-bit grayscale" IMAGE 2: 128 rectangles, each 80*30 pixels, with gray levels 1, 3, 5, ..., 255. "7-bit grayscale" IMAGE 3: 64 rectangles, each 160*30 pixels, with gray levels 3, 7, 11, ..., 255. "6-bit grayscale"

I then viewed the files in several graphics editing and viewing programs - starting with Windows Paintbrush and JASC Paint Shop Pro 3.12 - choice of application program doesn't seem to matter either.

What does matter is the choice of driver for the graphics board - like most vendors, Diamond provides several drivers with various resolutions and color depths - and then there are the "generic" drivers that come with MS-Windows - but all these drivers fall short, as follows:

(1) Diamond drivers described as "256 Color - 256k Palette" available at 640*480, 800*600, 1024*768 resolutions. The 6-bit, 7-bit, and 8-bit images all display as 6-bit, with 64 gray levels. (Odd flaw: one of light grays displays off-color, looks yellowish).

This actually makes perfect sense if you look at the description "256 Color - 256k Palette" which means "pick the best 256 colors from a larger, fixed set of 256k ò^18 ö4(reds)*64(greens)*64(blues)" So only 64 gray levels are available - or 64 levels, going from fully saturated to black, of any color.

(2) Diamond drivers described as "64k - High Color Mode" Also available at 640*480, 800*600, and 1024*768. Worse than above! Now all images display only 32 distinct gray levels.

This also makes sense because 64kÿ162*32*32*2 so 32 brightness levels are available for each color. Notice that although more colors can be displayed *simultaneously* than in the "256 - 256K Palette" mode, there are actually fewer colors total: 2^16 vs. 2^18

(3) Diamond driver described as "16M - True Color Mode" Now all the images display properly. I can see nearly 128 distinct rectangles, different shades of gray, in the 7-bit image (gray levels near black can't be resolved). The 8-bit image looks more like a gradient (smooth variation in brightness) than distinct rectangles.

The only problem is, the "16M - True Color Mode" is available only at 640*480 resolution at 60 Hz refresh rate - due to "bandwidth" limitations of the board - so in my opinion it is unusable in practice!

(4) "Generic" MS-Windows driver "Super VGA: 800*600, 256 colors" Images look the same as with the "256 color - 256K Palette" driver from Diamond, so this one must work the same way.

(5) "256 Color - 16M Palette" If such a driver existed, "pick the best 256 colors from a set of 2^24%6*256*256", it would solve the problem. BUT THIS DRIVER DOESN'T EXIST.

(6) "256 Gray Levels" If such a "grayscale-only" driver existed, it too would fix the problem, AND THIS DRIVER ALSO DOESN'T EXIST.

So to summarize, none of the existing drivers does what I want - display true 256 gray levels at a resolution of (at least) 800*600 at a refresh rate of (at least) 72 Hz. Microsoft or Diamond could have provided such a driver, but must have decided it wasn't worth the bother.

For comparison, I then took the TIF images to a Macintosh with 1 MB of video memory and Adobe Photoshop 2.5. All the images displayed correctly, true 256 gray levels at 800*600 resolution. Further, when I opened the images in Photoshop, I noticed that the whole desktop turned gray, including elements that normally display in color. I found that the Mac system software includes a "256 gray level" driver - unlike the PC-Windows system - so on the Mac, you can get a good grayscale display with less video memory. I would guess that Photoshop for Mac just switches drivers when it detects that a grayscale image is being opened.

So at this point, I really have three questions. (A) Is my analysis of the problem with MS-Windows graphics correct? (let me know if I've overlooked something) (B) Are there any freeware/shareware Windows video drivers that provide a "256 gray level" mode? Or, even better, a "256 Color - 16M Palette" mode, which would allow selection of *any* 256 colors from the full "true-color" set? (C) My Diamond board has 3 years left on a 5-year warranty. Do I have any chance of convincing Diamond that the grayscale problem is a defect that requires them to either write a new driver or send me a new and better graphics board? (Most of their current boards offer "800*600*16M Color" modes at refresh rates of 75 Hz or higher, unlike the one they sold to me in 1994.)

Opinions expressed in this letter are my personal opinions and do not represent the policies of the National Institute of Standards and Technology.

Lawrence H. Robins Ceramics Division National Institute of Standards and Technology Gaithersburg, MD 20899 mailto:lrobins@enh.nist.gov