Use the Graphics Formats VIs to read data from and write data to several standard graphics file formats, including bitmap .bmp, Portable Network Graphics .png, and Joint Photographic Experts Group .jpg files. You can use these VIs to perform the following tasks:

  • Read data from a graphics file for display in a 2D picture control.
  • Read data for image manipulation.
  • Write an image for viewing in other applications.

LabVIEW stores bitmap data in 2D arrays in which each point varies depending on the color depth. For example, in a black-and-white, or 1-bit, image, each point is Boolean. In 4-bit and 8-bit images, each point is an index in a color table. For 24-bit true-color images, each point is a mixture of red, green, and blue (RGB) values.

The VIs that read and write graphics files work with data in a simple, flattened format that is closer to the way graphics files are written to disk, with the data stored in a 1D array. These graphics files are pixmaps, which are similar in concept to bitmaps. You can display this flattened data directly using the Draw Flattened Pixmap VI.

To manipulate the data as a 2D array, you can convert it to the appropriate format using the Unflatten Pixmap VI and Flatten Pixmap VI.