Graphics    

Writing a Graphics Image

When you save an image using imwrite, the default behavior is to automatically reduce the bit depth to uint8. Many of the images used in MATLAB are 8-bit, and most graphics file format images do not require double-precision data. One exception to the MATLAB rule for saving the image data as uint8 is that PNG and TIFF images may be saved as uint16. Since these two formats support 16-bit data, you may override the MATLAB default behavior by specifying uint16 as the data type for imwrite. The following example shows writing a 16-bit PNG file using imwrite.


  Reading a Graphics Image Obtaining Information About Graphics Files