Write the image to a PNG file. The PNG format uses lossless compression.
imwrite(A,'myfile.png')
Read it back in using imread.
A_retrieved = imread('myfile.png');
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!