OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

imgRGBsplit

Contents

Menu Information

RGB Split

Brief Information

Split color image into R,G, B channels

Additional Information

This feature is for OriginPro only.

Command Line Usage

1. imgRGBsplit img:=[Mbook1]Msheet1!Mat(1);

2. imgRGBsplit img:=mat(1) r:=mat(2) g:=mat(3) b:=mat(4) colorize:=1;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Matrix img

Input

Image

<active>

Specifies the source image to manipulate. The default input is the active image.

Red Image r

Output

Image

<new>

Specifies the output image for the red channel. By default, an image named red will be used. See the syntax here.

Green Image g

Output

Image

<new>

Specifies the output image for the green channel. By default, an image named green will be used. See the syntax here.

Blue Image b

Output

Image

<new>

Specifies the output image for the blue channel. By default, an image named blue will be used. See the syntax here.

Colorize colorize

Input

int

0

Specifies whether to colorize the output images. If it is set to 1, the output images will be colorized, using palettes.

Description

The imgRGBsplit function splits the input color image into red, green and blue channels, allowing you to analyze or process the color channels separately.

Examples

In this example, we use the imgRGBsplit function to split the R, G, B channels of the input image:

  1. When the input image is active, select Image: Conversion: RGB Split. This opens the dialog of the X-Function.
  2. In the X-Function dialog, change the settings as the screenshot below and click OK to close the dialog.
    Image:imgRGBsplit_help_English_files_image002.jpg
    Three new images are created. They are the channel images for the input image.

Input Image

Image:imgRGBsplit_help_English_files_image004.jpg

Red Channel Image

Image:imgRGBsplit_help_English_files_image006.jpg

Green Channel Image

Image:imgRGBsplit_help_English_files_image008.jpg

Blue Channel Image

Image:imgRGBsplit_help_English_files_image010.jpg


Algorithm

In Origin, each pixel of a color image is represented by its R, G, B component. For splitting the color channels, we only need to separate the components for each channel.

If you choose to colorize the channel images, palettes will be used to apply pseudocolor to the channel images.

Related X-Functions

imgRGBmerge, imgPalette