HD Photo

From Wikipedia, the free encyclopedia

Jump to: navigation, search
HD Photo
Filename extension .hdp (formerly .wdp)
Internet media type image/vnd.ms-photo
Developed by Microsoft
Type of format graphics file format

HD Photo (formerly Windows Media Photo) is a still-image compression algorithm and file format for continuous tone photographic images, developed and patented by Microsoft as a part of the Windows Media family. It supports lossy as well as lossless compression, and is the preferred image format for Microsoft's XPS documents. It was previously known internally as Photon. Software support for the format is not widespread as of early 2007; however, official managed code and unmanaged code implementations of the codec are available as part of .NET Framework 3.0 and Windows Imaging Component respectively. Both components are part of Windows Vista and are available for Windows XP.

HD Photo has been announced by Microsoft and the Joint Photographic Experts Group to be under consideration for a JPEG standard, titled JPEG XR.[1] JPEG XR (ISO/IEC 29199-2, JPEG XR Image Coding Specification), based on Microsoft’s HD Photo proposal, reached the Final committee Draft (FCD) balloting phase in the ISO/IEC JTC1/SC29/WG1 workgroup.[2]

Contents

[edit] Description

HD Photo is an image codec that gives a high-dynamic-range image encoding while requiring only integer operations (with no divides) for both compression and decompression. It supports monochrome, RGB, CMYK and even n-channel color representation, using up to 16-bit unsigned integer representation, or up to 32-bit fixed point or floating point representation, and also supports RGBE (Radiance). It may optionally include an embedded ICC color profile, to achieve consistent color representation across multiple devices. An alpha channel may be present for transparency, and Exif and XMP metadata formats are supported. The format allows decoding part of an image, without decoding the entire image. Full decoding is also unnecessary for certain operations such as cropping, downsampling, horizontal or vertical flips, or cardinal rotations.

All color representations are transformed to an internal color representation. The transformation is entirely reversible, so, by using appropriate quantizers, both lossy and lossless compression can be achieved.

[edit] Container format

HD Photo uses a TIFF-like file container to store image data in a table of Image File Directory (IFD) tags. An HD Photo file contains image data, optional alpha channel data, HD Photo metadata, optional XMP metadata stored as RDF/XML, and optional Exif metadata, in IFD tags. The image data is a contiguous self-contained chunk of data. The optional alpha channel, if present, is compressed as a separate image record, enabling decoding of the image data independently of transparency data in applications which do not support transparency.

Being TIFF-based, this format inherits all of the limitations of the TIFF format including the 4 GB file-size limit, which according to the HD Photo specification "will be addressed in a future update".[3]

[edit] Compression algorithm

At a high level, HD Photo's design is very similar to JPEG: the source image is optionally converted to a luma-chroma colorspace, the chroma planes are optionally subsampled, each plane is divided into fixed-size blocks, the blocks are transformed into the frequency domain, and the frequency coefficients are quantized and entropy coded. Major differences include the following:

  • JPEG supports bit depths of 8 and 12 bits; HD Photo supports bit depths of up to 32 bits. HD Photo also supports lossless compression of floating-point image data; this works by representing the floating-point values in an IEEE 754-like format, and encoding them as though they were integers.
  • JFIF specifies a linear transformation from RGB to YCbCr, which is slightly lossy in practice because of roundoff error. HD Photo specifies a lossless colorspace transformation, given (for RGB) by
C_o = B - R\,
C_g = R - G + \left\lceil \frac{C_o}{2} \right\rceil
Y = G + \left\lfloor \frac{C_g}{2} \right\rfloor
  • While JPEG uses 8×8 blocks for its frequency transformation, HD Photo uses 4×4 blocks. 2×4 and 2×2 transformations are also defined for special cases.
  • The DCT, the frequency transformation used by JPEG, is slightly lossy because of roundoff error. HD Photo uses a transformation called the Photo Core Transform (PCT), a type of Hadamard transform, which resembles a 4×4 DCT but is lossless.
  • HD Photo allows an optional prefiltering step before the PCT. This filter has a visual blurring effect, but like the PCT it is lossless. The filter operates on 4×4 blocks which are offset by 2 pixels in each direction from the PCT blocks. Its purpose is to reduce block-boundary artifacts at low bitrates. At high bitrates, where such artifacts are typically not a problem, the prefiltering can be omitted to reduce encoding and decoding time.
  • In JPEG, the image DC components from the DCT are encoded by left-prediction. In HD Photo, blocks are grouped into macroblocks of 16×16 pixels, and the DC components from each macroblock are passed though another level of frequency transformation, leaving three types of coefficients to be entropy coded: the macroblock DC coefficients (called DC), macroblock-level AC coefficients (called "lowpass"), and lower-level AC coefficients (called AC).
  • HD Photo's entropy coding phase is far more complex than JPEG's, involving a more advanced DC prediction algorithm, adaptive coefficient reordering (in contrast to JPEG's fixed zigzag ordering), and a form of adaptive Huffman coding for the coefficients themselves.
  • JPEG uses a single quantization coefficient per DC/AC component per color plane per image. HD Photo has a similar restriction for DC quantization, but allows lowpass and AC quantization coefficients to vary from macroblock to macroblock.
  • Because all encoding phases except quantization are lossless, HD Photo is lossless when all quantization coefficients are equal to 1. This is not true of JPEG. JPEG defines a separate lossless mode which does not use the DCT, but it is not implemented by libjpeg and therefore not widely supported.

The HD Photo bitstream specification claims that "HD Photo offers image quality comparable to JPEG-2000 with computational and memory performance more closely comparable to JPEG", that it "delivers a lossy compressed image of better perceptive quality than JPEG at less than half the file size", and that "lossless compressed images … are typically 2.5 times smaller than the original uncompressed data".

[edit] Software support

[edit] Licensing

Microsoft has patents on the technology in HD Photo. A Microsoft representative stated in a January 2007 interview that in order to encourage the adoption and use of HD Photo, the specification is made available under the Microsoft Open Specification Promise, which asserts that Microsoft offers the specification for free, and will not file suit on the patented technology, and that open-source software can therefore make use of the format.[7] as stated by to Josh Weisberg, director of Microsoft's Rich Media Group. However, as of Microsoft's September 9, 2008 update, HD Photo is still not among the technologies that Microsoft has listed as being covered by the Open Specification Promise.[8]

In addition to the specification itself, Microsoft released the "HD Photo Device Porting Kit" which provides source code and build configuration files for multiple platforms. While the license for this code is designed to encourage broad adoption in products, the license terms specifically prohibit including any of Device Porting Kit's code in products or systems that use strong copyleft licensing.[9]

2. c. Distribution Restrictions. You may not … modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that the code be disclosed or distributed in source code form; or others have the right to modify it.

As a consequence, any implementation that would be suitable for inclusion in a software package distributed under the GNU General Public License would need to be written from the HD Photo Bitstream Specification (also assuming Microsoft does cover HD Photo under the Open Specification Promise), although the licenses such as the Open Source Initiative-approved BSD license would likely be acceptable.

[edit] See also

[edit] References

[edit] External links

Personal tools