I am writing to an image file using the IMWRITE function. I have specified the mode to be 'lossless'. The image file is not viewable outside of MATLAB. I have tried a number of different viewers. I can read the image back into MATLAB and display it. If I specify the mode to be 'lossy', the image is viewable outside MATLAB.
I am using the following code to create the image:
x = rand(100,100);imwrite(x,'test.jpg','mode','lossless');
Best Answer