简体   繁体   中英

Matlab imread return 4 channel matrix

I do imread image in Matlab, and it returns a 4-channel image:

im: 1012x972x4 uint8.

Which format is this image? How to check its color format(RGB, CMYK, etc)? I opened it in Gimp and the color profile is simply sRGB built-in

From imread() documentation :

The return value A is an array containing the image data. If the file contains a grayscale image, A is an M-by-N array. If the file contains a truecolor image, A is an M-by-N-by-3 array. For TIFF files containing color images that use the CMYK color space, A is an M-by-N-by-4 array. See TIFF in the Format-Specific Information section for more information.

So the answer is apparently that this image's color space is CMYK.

If you want to check for a general input, then, from the same page:

To determine which color space is used, use imfinfo to get information about the graphics file and look at the value of the PhotometricInterpretation field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM