Example Code

Write AVI File with New Color Palette

Code and Documents

Attachment

Overview

This example turns grayscale images into a different color palette and then writes the new images to a AVI file.

Description

In LabVIEW, we can easily view a grayscale image in a different color palette by simply selecting the color palette on the Image Display indicator itself.  We can also modify the images to contain the new color palette information, allowing us to create AVIs with the new display.  In this example, we turn a grayscale image to an array of pixel values, which we then replace with the corresponding values from the selected color palette.  After that, the array is turned back to an image and the frame is written to the AVI.

Steps to Implement or Execute Code

  1. Download the VI
  2. Specify a camera in the Session In on the Front Panel
  3. Select the AVI Path
  4. Run the VI

Requirements

Software

LabVIEW 2009 or later

NI Vision Acquisition Software

NI Vision Development Module

Hardware

Compatible camera

Please see the following link to determine if your camera is supported

VI Snippet

RainbowAVI.png

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**

Cole R.
National Instruments
Software Engineer

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

Comments
Gregory
Trusted Enthusiast
Trusted Enthusiast
on
Contributors