Image File Formats

Once you have acquired images, you may need to save or convert them to an appropriate file format for editing or output. Some imaging applications will save images in a native file format that is specific to that particular program. These file formats aren’t always readable in other software applications. When scanning, editing or exporting images for presentation, email, or web use it becomes important to choose a file format that is best suited for the job at hand.

The format you choose for saving an image will have a significant effect on file size. File size may be an important consideration, especially when dealing with a large number of image files. Different file formats provide varying degrees of data compression, which can impact image quality.  There are two types of data compression: lossless and lossy. Lossless compression can achieve about a 2:1 compression ratio, but the reconstructed image is identical to the original. Lossy compression offers higher compression rates and smaller file sizes, but the loss of data can be visible to the eye. The most commonly used universal file formats are TIFF and JPEG.TIFF (Lossless) is a good choice for archiving important images. The JPEG (Lossy) format is useful for compressing images (smaller file size) for transfer over the Internet.

Cross Platform Formats

JPEG (*.jpg) is one of the most commonly used image file formats. Almost all programs that handle images in both the PC and Macintosh environment are capable of opening and saving JPEG files. The JPEG format is particularly useful for images intended for Internet use. It works well on both full color and grayscale photographic images, but is not recommended for text or line art.

Developed by the Joint Photographic Experts Group, this file format uses a “lossy” compression technique that can significantly reduce image file sizes. JPEG compression can reduce a file to as much as 5% of its’ original file size. This format is popular because the compressed files take up less storage space than other formats.

compression1
As compression increases to reduce file size, pixellated compression artifacts become more apparent.

The resulting compressed files are efficient for transmitting across networks or distributing by email. Too much compression however, will significantly reduce image quality. The amount of compression can be selected by the user to find a balance between compression and quality.  At high zoom levels, a loss of sharpness is apparent along with visible compression artifacts in JPEG files.  Artifacts may appear as pixilated or crosshatched blocks that obscure detail, or “fringing” defects seen along edges.

compression2
JPEG compression artifacts occur more frequently in areas of little detail. Notice the “blocky” artifacts in the macular area on the left side of this image. The same artifacts do not appear near the optic nerve and retinal vessels because there is more detail in those areas and the compression algorithms do a better job there.

Each successive time a JPEG image is saved, image-quality degenerates further. To avoid this problem, limit the number of times JPEG files are altered and saved.  It is best to reserve the use of this format for a final save in circumstances where compact file sizes are essential.  Other image file formats like PNG or TIFF are considered more appropriate for preserving the integrity of medical images.

TIFF (*.tif) The Tagged Image File Format is a universal file format supported by many applications and computer platforms. It is useful for saving master copies of important images. It is a popular choice for working with images in an image-editing application. The major disadvantage to this format is that it results in a large file size. The TIFF format supports optional LZW compression, which is a lossless compression technique that nominally reduces file size while maintaining image quality. This compression technique doesn’t compress file size enough for email or web use. Not all graphics programs recognize LZW compression and may not be able to open compressed TIFF files.  Uncompressed TIFF files are popular for archiving and publication purposes.

GIF (*.gif) Graphics Interchange Format was originally designed for Internet use. GIF also uses lossless LZW compression, but images are limited to 256 colors which makes this format a poor choice for 24 bit color photographic images. The GIF format is best suited for simple graphics or grayscale photographic images.

PNG (*.png) Portable Network Graphics This format was designed as an alternative to the GIF format. It uses LZW compression like GIF, but is not limited to 256 colors. File sizes are larger than JPEG or GIF, but smaller than TIFF with similar quality. IPNG results in a good compromise between file size and image quality. It is an excellent choice for lossless compression of medical images.

BMP (*.bmp) The Windows Bitmap format is the basic imaging format used in Window-based computers. It is a lossless format with large file sizes. It is most commonly used for images that will be displayed as Windows desktop wallpaper.

RAW (Canon .crw, Nikon .nef, Olympus, .orf, etc.) Camera Raw refers to unprocessed or minimally processed proprietary formats specific to different camera manufacturers. These files contain more image data than the universal formats and have the potential for rendering the best quality output, especially in difficult exposure or lighting situations. They require a conversion program for processing and are impractical for routine, high volume medical imaging.

DICOM (.dcm) DICOM stands for Digital Imaging and Communication in Medicine. It is a universal communication protocol for sharing medical images across different devices and platforms. DICOM files are capable of storing meta dataincluding medical information and patient demographics. DICOM files require a DICOM viewer to open or convert to other file formats.

Native Image-Editing Program Formats

Many image-editing programs use a proprietary file format that supports an editing feature called layers. The layers feature enables the precise editing of various elements in a photograph, independent of other elements within the same image file. File formats that support this feature save the layers separately to allow further editing. These formats are lossless and can be quite large in size. Popular image-editing programs that support layers include: Adobe Photoshop (*.psd), Corel Paint Shop Pro (*.psp),GIMP (.xcf)

Universal photo formats (like TIFF and JPEG) do not support multiple layers. If you want to keep a copy of your image with the layers separate (that is, still available for independent editing), then you must save it in the photo editing program’s native format. If you decide to save the picture in another format like TIFF or JPEG, the layers will automatically be merged into a single background layer during the save process.

compression4

compression3
Halo artifacts often appear along sharp edges in compressed JPEG files.