Write JPEG File VI

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

Owning Palette: Graphics Formats VIs

Requires: Base Development System

Writes a JPEG file.

If you want to write a pixmap to a file, use the Flatten Pixmap VI to convert the data to an image data cluster before using this VI. If you want to write a picture to a file, use the Picture to Pixmap VI to convert the data to an image data cluster before using this VI.

quality specifies the level of quality you want for the JPEG using the IJG JPEG library scale, which ranges from 0 to 100. The default is 80. The scale balances image quality and file size. A value in the 75–95 range produces a compressed file with a high-quality image, and a value below 50 produces a smaller file size with a low-quality image.
path to JPEG file specifies the path to and name of the JPEG file to write. If you do not specify a path, LabVIEW displays a file dialog box so the user can navigate to the file.
image data describes the image you want to draw or manipulate. If you wire 32-bit image data to this VI, the VI returns a 24-bit pixmap.
image type is reserved for future use.
image depth specifies the color depth of the image, which is the number of bits to use to describe the color of each pixel in the image. Valid values include 1, 4, 8, and 24 bits per pixel. image depth affects how LabVIEW interprets the values of image and colors.
image is an array of bytes that describes the color of each pixel in the image in raster order. The value of image depth determines how LabVIEW interprets the value of this input. If image depth is 24, each pixel has three bytes to describe its color. The first byte for each pixel describes the red value, the second byte describes the green value, and the third byte describes the blue value.

If image depth is 8, each pixel has one byte to describe its color. The value of each byte corresponds to an element in colors, which stores 32-bit RGB values where the most-significant byte is zero, followed in order by red, green, and blue values. Valid values include 0 through 255.

If image depth is 4, the behavior is similar to when image depth is 8 except valid values in image include 0 through 15.

If image depth is 1, any value of zero in image corresponds to element 0 in colors. All other values correspond to element 1 in colors.
mask is an array of bytes in which each bit describes mask information for a pixel. The first byte describes the first eight pixels, the second byte describes the next eight pixels, and so on. If a bit is zero, LabVIEW draws the corresponding pixel as transparent. If the array is empty, LabVIEW draws all pixels without transparency. If the array does not contain a bit for each pixel in the image, LabVIEW draws any pixels missing from the array without transparency.
colors is an array of RGB color values that correspond to the values in image. The value of image depth determines how LabVIEW interprets the value of this input. colors stores 32-bit RGB values where the most-significant byte is zero, followed in order by red, green, and blue values. Valid values include 0 through 255. In the Write File VIs (BMP, JPEG, and PNG), LabVIEW does not have an automatic color table. Use the colors input even for image depth of lower bit value to ensure the best performance of the Write File VIs.

If image depth is 24, LabVIEW ignores this input.

If image depth is 8, the array can have 256 elements.

If image depth is 4, the array can have 16 elements.

If image depth is 1, the array can have 2 elements.
Rectangle is a cluster that contains coordinates that describe the bounding rectangle of the image. The bottom and right edges of the rectangle bounds do not contain image pixels. Horizontal coordinates increase to the right, and vertical coordinates increase to the bottom.
left is the horizontal coordinate of the left edge of the rectangle.
top is the vertical coordinate of the top edge of the rectangle.
right is the horizontal coordinate of the right edge of the rectangle.
bottom is the vertical coordinate of the bottom edge of the rectangle.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
path specifies the path to the JPEG file.
error out contains error information. This output provides standard error out functionality.

WAS THIS ARTICLE HELPFUL?

Not Helpful