MATLAB: Images dose not save incorrectly

image processing

When i try to save an image in double mode using imwrite it is save incorrectly it is save as a white image ,, help please

Best Answer

Try this to cast it to 8 but unsigned integer, which most standard image formats want:
image8bit = uint8(mat2gray(doubleImage));
imwrite(image8bit, fullFuleName);
or else save it as a mat file (but then only MATLAB can see it):
save(matFileName, 'doubleImage');