From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Save Complex Image to File using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Vision Development Module
  • LabVIEW

Code and Documents

Attachment

Overview

This example demonstrates how to save complex data to an image file.

 

Description

Complex images are typically created when performing a fast fourier transform (FFT) on an image. Pixels in a complex image consist of a real component and an imaginary component. The complex image type cannot be saved to a file format that other programs can read.  When saving in other file formats, the phase (imaginary) information of the complex image will be lost.

 

This example can save a complex image to another file type including JPG, PNG, and BMP.  This examlpe uses an invoke node to take a "screenshot" of a front panel image display and save this image to file.  This does not save any of the complex information associated with the image but it does allow the user to save a "screenshot" of the complex image being displayed.


Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • NI Vision Development Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download and open the attached file
  2. Run the program

 

Additional Information or References

Save Complex Image to File LV2012 NIVerified.vi - Front Panel.png

 

Save Complex Image to File LV2012 NIVerified.vi - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Justin D.

Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.