How can I know the number of channels available for a particular image (tiff/png) in MATLAB 7.6 (R2008a)?

27 views (last 30 days)
A TIFF image can have a number of channels as follows:
- a single channel specifying a black-and-white image
- three channels specifying a color image in RGB color space
- four channels specifying a color image in CMYK color space.
- any number of alpha channels specifying masks and selections
I want to find out the number of channels that my image has.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
You can use the IMINFO function to derive this information from the TIFF image. The available number of channels will be one greater than the result.
info = imfinfo( 'demo.tif' );
% The available number of channels
channels = info +1;

More Answers (0)

Tags

Products


Release

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!