Fundamentals of Digital Imaging
    File formats and color depth
    Arch 5710, Photography and Digital Media,, University of Virginia
    Copyright © 1999-2009 Kirk Martini.Last Modified Tue September 1, 2009 11:54
    Table of
    Contents

    Color Depth

    The number of colors that can be assigned to a pixel depend on how many bits of data are assigned to each pixel.

    1 Bit Color: Bitmap
    Each pixel is pure black or pure white (the pixel can take a value of 0 or 1)
    8 Bit Color: Greyscale or Indexed Color
    Greyscale
    One byte (8 bits) per pixel. The total number of shades of grey is 28 = 256.
    Indexed Color
    One byte (8 bits) per pixel. Each pixel can be assigned one of 256 preselected colors.
    8 bits/channel RGB:
    One byte each for a red value, a green value, and a blue value at each pixel. An RGB image is effectively three greyscale images, one each for red, green and blue. These are called channels. The total number of possible colors is 2563 = 224= 16.8 million.
    8 bits/channel CMYK
    One byte for each value of cyan, magenta, yellow, and black. This leads to 232 = 4.3 billion different numeric values, but not to 4.3 billion colors, since many are redundant (e.g. one color may be represented may many different combinations of CMYK values).
    16 bits/channel RGB:
    2 bytes each for a red value, a green value, and a blue value at each pixel. In theory, this leads to 248 = 281 trillion collors, but Photoshop actually uses only 15 bits per channel, so the total is about 35 trillion colors. This format is becoming more common since recent releases of Photoshop support more operations with it. Images captured in RAW format should be converted to 16 bit images initially.
    32 bits/channel RGB (High Dynamic Range, HDR):
    This is an emerginig format that supports more colors than can be displayed on any monitor or printer, or captured by any camera. Photoshop can construct HDR images from multiple exposures of the same scene. This format will become more important in photographic practice over the next five to ten years.

    File Formats

    Distinguishing Characteristics:

    • Color depth
    • Compression method
    • Proprietary vs. Open

     

    TIFF

    (tagged image file format)

    Color Model 8-bit greyscale; 8, 16. 32 bits/channel color
    Compression LZW and Zip compression are lossless
    Proprietary Tiff is an open standard that is not proprietary.
    Comments Because of its high color depth, lossless compression, and open standard, tiff is the format of choice for archiving images. The file sizes are generally too big for web distribution.

    The tiff format has expanded in the past five years to support layering and almost all features of Photoshop PSD files.

    JPEG

    (joint photographers expert group)

    Color Model 8-bit greyscale or 8 bits/channel color.
    Compression The compression method is lossy, but is adjustable, achieving better compression with reduced quality. The compression method aims at images with smooth variations in tone, and introduces noise where there are sharp edges with high contrast. Compression can reach more than 10 to 1, depending on the image.

    The image is recompressed with each open-close cycle of a file, so the quality degrades wity multiple open-close cycles.

    Proprietary JPEG is an open standard.
    Comments Because of its efficient compression and high color depth, jpeg is the format of choice for distributing photographic images on the web.

    Because of the degradation in quality with open-close cycles, jpeg should not be used as a format for working with files, only final delivery.

    GIF

    (graphic interchange format)

    Color Model 8 bit greyscale or indexed color.
    Compression Lossless. The compression method is well suited to large areas of constant, flat, color, such as graphic illustration or text.
    Proprietary GIF is a widely adopted standard, but part of it is proprietary.
    Comments GIF is well suited to illustration graphics, widely use in web banners and buttons. It is not well suited to photographs because of the low color depth.

    RAW

    (Canon CRW,
    Nikon NEF,
    Pentax PEF,
    Adobe DNG,
    etc.)

    Color Model Typically 12 bits/channel for digital SLR (DSLR).
    Compression Some manufacturers use lossless compression, others do not compress.
    Proprietary Yes. Each camera manufacturer uses its own raw format.

    Adobe is attempting to introduce a standard raw format called Digital Negative (DNG). Adobe provides free software to convert most manufacturer's RAW files to DNG, but so far only Pentax has chosen to produce DNG files direclty in the camera.

    Comments The raw files stores the data captured by the sensor without processing. The data will be different depending on the type of sensor.

    The raw format bypasses all in-camera processing concerning white-balance, saturation, contrast, and sharpening and allows you to do this processing on the computer. RAW files contain much more information and jpegs from the camera, but their archival future is questionable.

    Photoshop Color Model From 1-bit to 32-bits-per-channel color.
    Compression Photoshop files seem to use a form of lossless compression.
    Proprietary Yes.
    Comments They key feature of photoshop files is that they include layers, which allow an complex image to be edited. TIFF is the only other format that supports layers.

    Other seldom-used photo formats: PNG, JPEG2000, BMP.

    Effects of Compression

    The difference between a GIF and a JPEG

    A detail of a GIF file:

    A detail of the same file as a jpeg:

     

    Under extreme compression, jpeg images show a pattern of 8x8 pixel squares, with significant noise introduced at sharp edges.

    A 522K jpeg generated from a 1 megabyte tiff. High quality, low compression.

    A 53 K jpeg generated from the same tiff. High compression, low quality.

    Details from the above images

     

    Embedded Color Profiles

    In addition to storing the numeric pixel values, files generated by Photoshop may also include "color profiles", which include information about the "color space" corresponding to the RGB numbers in the file. The purpose of color profiles is to get consistent color across multiple devices that produce color differently (e.g. monitors from different manufacturers, ink-jet printers, offset presses, etc.).

    Color profiles are powerful. Like most powerful things (e.g. chain saws and bulldozers) they are extremely useful when used correctly, and extremely dangerous when used incorreclty. We'll examine profiles in more detail later in the course. The following is a brief overview with advice about how to avoid damaging files through improper use of profiles.

    A color profile maps numeric values to actual colors as they appear to your eye. They account for the fact that a number such as RGB (100,150,200) may appear to be different colors on different devices. Color profiles are used to adjust the numbers so that the colors look the same.

    There are two widely used color profiles associated with digital image files.

    • Adobe 1998: This is widely used by professionals,and covers a wide color gamut (i.e. range).
    • sRGB: This is a "lowest common denominator" profiles whose gamut includes the range of colors found on cheap computer monitors.

    Most digital cameras give a color-space option to use one of these two spaces. I have the following recommendations.

  • If you are unfamiliar with profiles, and would rather not think about it for now, use sRGB. sRGB is also appropriate for images that will be seen only on the web.
  • If you want to get the most information in every photo, and plan to produce high-quality prints, use Adobe 1998. It requires extra steps, but includes a bigger color space than sRGB. Images captured in Adobe 1998 should be converted to sRGB for web display.
  • A few rules concerning safe work with profiles:

    • Don't convert a profile unless you are sure you want to.

    Sometimes you will see the following dialog when you open a file. The safe thing is to click Use the embedded profile. This will preserve the numbers in the file.

     

     

    • Pages 27-35 of Creative Digital Darkroom gives an overview of color management in Photoshop.

    Summary

    Resolution = (Pixel Dimension) / (Print size)
      The issue of image size and resolution is a major source of confusion. Thoroughly the relationship above is essential. Also remember that resampling means that pixel dimensions are changed.
    Color Depth means the number of different colors that can be assigned to a pixel.
      That number in turn depends on how many bits are assigned to the pixel, which can range from 1 bit (2 colors) to 48 bits (281 trillion colors). For photographic work 24-bit color (16 million colors) and 8-bit greyscale (256 shades) are generally sufficient.
    Different file formats are suited to different purposes.
     
    • TIFF: up to 48-bit color; lossless compression. The best format for archiving.
    • JPEG: 24-bit color; lossy, adjustable compression. Use for web distribution of photographs.
    • GIF 8-bit color, lossless compression. Use for web distribution of illustration graphics. Not for color photographs.
    • Photoshop: 1-bit to 16-bits-per-channel color. Lossless compression. Use to preserve layered structure for later editing.
    Arch 5710, Photography and Digital Media,, University of Virginia
    Copyright © 1999-2009 Kirk Martini.Last Modified Tue September 1, 2009 11:54
    Table of
    Contents