rgb2gray

Image Processing

Convert an RGB or RGBA image to grayscale using luminance weighting.

Syntax

gray = rgb2gray(img)

Examples

gray = rgb2gray(imread("/cat.jpg"))
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.