Imwrite creates 8bit tif file despite 16bit input
Show older comments
I have several 16bit images in a 3D array A. I want to save those images as one tiff file. However when using imwrite the images are stored as 8bit file.
The code is:
imwrite(A(:,:,1),'folderpath/test123.tif');
for n = [2:1:amount_of_images]
imwrite(A(:,:,n),'folderpath/test123.tif','WriteMode','append');
end
In the target folder one 8bit tif file appears, which is copletly white since all values in the original image are above 2^8-1
In the "current folder section" on the left the tiff file is also declared as 8bit. Judging by the documentation imwrite should recognise the 16bit, right? What am I doing wrong?
P.S. I am using R2019b
Accepted Answer
More Answers (0)
Categories
Find more on Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!