TIFF16 image looks different in windows file viewer and MATLAB -
general problem description
i have 33 tiff16 images , want processing on them using matlab. reading them first step. after download image web , try read using matlab's imread
(as tiff
, read
). display image using imshow
. image displayed windows file viewer , matlab totally different. cannot process them since don't trust matlab has read them correctly. give more specifics of problem now.
edit: if helps, details of tiff16 images are: tiff (16 bits per channel, prophoto rgb color space, lossless compression)
more details:
i download image a0008-wp_crw_3959.tif
. destination: go this link -> img0008
-> expert b (in case wants try, otherwise have screenshots below).
i read image in matlab using: img=imread('imgfilename.tif','tiff'); imshow(img,[]);
or
t = tiff('imgfilename.tif','r'); imagedata = read(t); imshow(imagedata);
now, display snapshots of windows file viewer:
next, snapshot of matlab shows me:
now, have reason believe windows file viewer correct. go same link previous. scroll down img0008
. hover mouse onto leftmost img0008
. thumbnail view of expert b
come looks same windows shows me.
does know how make matlab read , show tiff16
image correctly?
thank @markransom pointing me embedded color profile possibility. believe following solution correct , produces same output windows file viewer.
first read icc-color-profile using iccread
command.
i_rgb = imread('a0008-wp_crw_3959.tif'); outprof = iccread('srgb.icm'); p = iccread('a0008-wp_crw_3959.tif');
then convert image srgb
profile using makecform
, applycform
:
c = makecform('icc',p,outprof); i_cmyk = applycform(i_rgb,c); imwrite(i_cmyk,'pep_cmyk.tif','tif') info = imfinfo('pep_cmyk.tif'); imshow('pep_cmyk.tif');
the original image saved on disk , new - pep_cmyk.tif
- same windows file viewer.
Comments
Post a Comment