Save the image matrix in TIFF format with MATLAB. First, we use the Imread function to open a picture I = IMREAD ('c: \ users \ hzf \ documents \ MATLAB \ data \ Lena.jpg').
Use the imwrite function to save the image in TIFF format. If the image is img, you can use imwrite(img,' result.tiff').
Sometimes you will see that the saved image is white. In imwrite(A, filemane), if the image is a, there are two possibilities.
1)A data is an integer from 0 to 255;
2) Double precision type, with the value range of 0-1.0; Save the displayed image as blank, which means that A should be an integer, but it is actually a double type. If the value exceeds the specified value 1.0, it will be displayed in white.
Solution:
1) double can be converted into integer data between [0-255] by using the uint8 function.
2) you can scale A = A/255 to [0- 1] and then imwrite(A, filemane).