File Exchange

image thumbnail

RGB to Black and White

version 1.0 (81.9 KB) by

Converts RGB images to black and white images

1 Download


View License

This code converts an RGB image to a black and white image in C with MEX. I this together for a school project and I couldn't find any good examples of MEX with image processing. One note the code is currently hard coded to handle only UINT8, however it should be trivial to convert that data type. Enjoy.

Comments and Ratings (3)

umer fareed

How it works? I don't know much about how to run MEX file.

Anthony Gabrielson

Your right it did just handle grayscale. I threw in a function so it can take the grayscale image and convert it to a black & white.

Matt -

This isn't RGB to black and white, it's RGB to gray scale.


Cleaned up the code a bit.

MATLAB Release
MATLAB 7.1.0 (R14SP3)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video