Value range of grayscale image not being correct?
9 views (last 30 days)
Show older comments
Hi, I used following script to convert a cmyk image into rgb and then convert it into grayscale, but after this I got a array with all values being either 35 or 37, not 0 or 1.
I think that grayscale image should generate array with values being either 0 or 1, right?
How can get final array with values in the range [0,1]?
clear all, close all clc I_cmyk=imread('jetflow.tiff'); C=makecform('cmyk2srgb'); I_rgb=applycform(I_cmyk,C); I_gray=rgb2gray(I_rgb);
Plus: after I use imread function to load the tiff image, it generated a 1280x800x4 uint8 array, which should be cmyk format, so I used the following 3 lines of commands.
Thank you.
0 Comments
Accepted Answer
Image Analyst
on 30 May 2014
They're probably in the range 0-255. If it's a uint8 image, they they almost certainly are in that range.
2 Comments
Image Analyst
on 30 May 2014
When you want to deal with an image in that range, which I never do. It's just confusing to me so I don't. I always use the original range, even when it gets converted to double.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!