MATLAB: Use imwrite to save tif images

Image Processing Toolboximwrite

I want to save a 3 color image as a lossless tif image. When i tried
imwrite(image,'test.tif','Mode','lossless')
I got an error message. Is there any way to save an image as a lossless tif? Thank you.

Best Answer

"I got an error message" is a useless statement if you don't give us said error message. Thankfully, you've finally given it in a comment to Image Analyst's answer.
'Mode' is indeed not a valid option for TIF. Probably, the nearest available option would be Compression. However, note that the default compression method for colour images is 'packbits' which is lossless anyway. In fact, the only compression mode that is lossy is 'jpeg' which you'd have to set explicitly. So really, for lossless TIF,
imwrite(im2uint16(NewImage), 'test.tif')
is all that is needed.