Could you share the .img file if possible.
.img (double) to .png (double) using imwrite
2 次查看(过去 30 天)
显示 更早的评论
I have a .img file of datatype double (666*512). I want to convert it into .png file with out any loss. I'm using imwrite and the png file obtained has a dimension of 666*512 datatype uint8 due to which I'm not able to view the image. I have read the imread documentation.
"imwrite(A,filename) writes image data A to the file specified by filename, inferring the file format from the extension. imwrite creates the new file in your current folder. The bit depth of the output image depends on the data type of A and the file format. For most formats:
If A is a grayscale or RGB color image of data type double or single, then imwrite assumes that the dynamic range is [0,1] and automatically scales the data by 255 before writing it to the file as 8-bit values. If the data in A is single, convert A to doublebefore writing to a GIF or TIFF file."
I would like to know is there a way for me to convert the raw image(.img of type double) to png image (type double) so that I can view the png file which is same as .img file (pixel by pixel).
Thank you so much for your time.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!