Archived:My Displayed Grayscale Images are Poor or Incorrect

Updated Feb 2, 2018

National Instruments does not actively maintain this document.

This content provides support for older products and technology, so you may notice outdated links or obsolete information about operating systems or other relevant products.

Reported In

Software

  • LabVIEW Full
  • Vision Development Module

Driver

  • NI-IMAQ

Issue Details

Why are my displayed grayscale images poor in quality or incorrect?

Solution

The color palette used for your monitor is important when displaying grayscale images in LabVIEW, LabWindows/CVI, or Visual Basic. Ideally, your color palette should be greater than 256 colors. In order to change the color palette:

  • Open the Display Control Panel Start » Settings » Control Panel » Display.

  • On the Settings tab, change the color palette to High Color (16 bit) or better.

  • If your palette is 256 colors or less, images will not be displayed correctly in LabVIEW or LabWindows/CVI.

Additional Information

In LabVIEW, you will only have about 11 grayscales when displaying with a 256-color palette.

When using the CVI NI-IMAQ example, the picture will be displayed briefly with random colors and then disappear.

The solution for both of these is to use greater than a 256-color palette.

In Visual Basic, by default, all images will display with about 11 grayscales as well. However, Visual Basic allows you to create a custom palette which lets you display many more grayscales. To do this, select the form and change the Palette Mode to 'custom.' Then for Palette, open up any image which contains the grayscale values you would like to use. This image doesn't need to be large but should be just large enough to contain one pixel of each of the grayscale values you would like to use. When the program is running, the operating system selects the color palette of the active window and uses it. 

WAS THIS ARTICLE HELPFUL?

Not Helpful