MATLAB: How to convert a tif grayscale image into other form without losing information

.jpgconvertImage Processing Toolboxpngtiftransform

Hello,
I want to convert tif grayscale image into other forms, such as jpeg, png, or others. I searched with Google but no useful solution was found. Anyone here can help me? Appreciate.
Y.

Best Answer

Not all TIFF files can be converted to other forms without loss of information. TIFF files are allowed to contain data that is complicated in ways that cannot be reproduced in the other file formats that you mention.
If you simply need to change a grayscale image to another form, and do not need any of the complications to be transferred with it, then:
in_name = 'xyz.tif'; %the name of your input image
out_name = 'xyz_converted.jpg'; %the name of the desired output
IM = imread(in_name); %read in the image
imwrite(IM, out_name); %write it out