Reading and Writing Image Files

Contents

Description

Reading and writing image files is simple with IMAQ Vision. By using built-in IMAQ Vision functions, you can store and retrieve images in the following formats:

BMP
Bitmap (BMP) is an uncompressed Windows format, supporting 8-bit unsigned integer images or 32-bit color formats. It stores calibration information about the physical size of the image along with the pixel data. Bitmaps are handy for editing, screen captures, and so on, since the format reproduces the image exactly and doesn't require coding and uncoding. The file extension is .bmp.
JPEG
Joint Photographics Experts Group (JPEG) is a lossy compressed format with a selectable compression level. It supports the same image types as the bitmap, but stores no calibration information. The compression algorithm uses the Discrete Cosine Transform (DCT), which operates on blocks of the image data. At high compression levels, this leads to fairly severe blocking artifacts in the reconstructed images. JPEG is not recommended if you will need to make precise measurements on the reconstructed image. The file extension is .jpg.
TIFF
Tagged Image File Format (TIFF) is a versatile, but older format. It allows for both uncompressed and lossy or lossless compressed storage. It supports the same file types as JPEG and BMP, and also allows for a signed 16-bit integer format. The format is not standard, however, and is not recommended since files saved in the format cannot be opened in some applications. It stores calibration information, and contains several other obscure features. The file extension is .tif.
PNG
Portable Network Graphics (PNG) is a newer lossless compressed format. It supports a 16-bit integer storage format, as well as 8-bit integer and color. Calibration information can be saved along with the image. The user can specify a compression level, but all levels are lossless. The file extension is .png.
AIPD
AIPD is an uncompressed format used internally by LabVIEW to store images of any type, along with calibration information and other specifics that define the image characteristics completely. The file extension is .apd.

AVI
AVI is a file type that stores multiple images in a single file. AVI is provided with NI-IMAQ or Vision, but if NI-IMAQ is the only software installed, users will only be able to write uncompressed AVIs. If users have Vision installed, they will be able to read and write compressed or uncompressed AVIs. The file extension is .apd.


NOTE: 16-bit TIFF images do not have a standard file format. If you save a 16-bit TIFF file using IMAQ Vision, you may not be able to use that image in other applications.

Use the PNG file format to save overlays, calibration information, user text, and pattern matching template information for an image. Saving this information eliminates the need to repeat the learning phase each time you run the application.

NOTE: This image information can only be saved in the PNG file format, and you must call an API-specific IMAQ Vision function to read images that you save in this manner.

  • For LabVIEW, call IMAQ Read Image and Vision Info
  • For CVI/C, call imaqReadVisionFile
  • For Visual Basic, call CWIMAQVision1.ReadImageAndVisionInfo

Save your images using the appropriate IMAQ Vision function to ensure that the image and its learned information are saved together.

Common Applications


Store images for later viewing or processing. Retrieve same images or others created outside IMAQ Vision.

What To Expect


You will be able to save any image from within your application as one of the standard file formats listed above. You will also be able to open any images that follow these formats.

Related Links:

Was this information helpful?

Yes

No