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
The lossless JPEG format is not a popular format and is not supported by most common applications including Microsoft applications. The more popular JPEG format is lossy.
Lossless JPEG should not be confused with JPEG-LS a new standard which uses lossless compression. MATLAB does not support JPEG-LS.
PNG is a common lossless compression format. The following code writes an image to PNG format:
Best Answer