Aug 1, 2007

MS HD-photo, really as good as they say?

Recently read that the new image format shipped with windows vista (a.k.a. Windows Media Photo) has opened up dialog between the Joint Photographic Experts Group and Microsoft. The format is now under standardization consideration.

According to Microsoft this format is superior to the old Jpeg-format by a number of factors.
  • up to 32-bit floating point colorspaces.
  • Separate alpha and x-channel handling.
  • Better compression due to lowpass/midtone/higpass separation and re-encoding step. This according to Microsoft allows for smaller files with same quality as previous Jpeg-files.
  • 4x4, 4x2 or 2x2 macroblocks instead of standard 8x8.
  • Lossless DCT-based compression.
All this got me wondering about the practical aspects of deploying this format into a production pipeline or for web use. I then found that Microsoft has released a BETA-version of the file format available as a plugin for Adobe Photoshop, versions CS2 and CS3. This plugin can be found here.

I have a theory about lossy compression (as I previously worked a bit on video-compression for web-deployment):
A compression-method has an optimum range for compression based on the algorithm involved in reducing the file size.
Example: The gif-file structure is perfect for images with few colors (such as simple illustrations). When the colors increase the format deteriorates in size efficiency, up to 256 colors, where the palette caps, along with the usefulness of the format.

I set up two test cases to test if there was any kind of optimum range of the new format.

In the first case I tried to simulate a scenario most probable for a standard photographer archiving a photo for later reference.
I used a standard 10 megapixel raw-image converted to 8-bits (3338x2384 pixels) and compressed it with the 60% jpeg-setting in photoshop. I then matched the filesize with the HD-photo-format and compared the images with the original uncompressed image.
The images below the original are differences in pixels of the two encodings, where black means no difference. Simply, the whiter the image, the poorer the compression.
The results of this conditions show that that HD-photo is clearly superior to Jpeg in preserving the pixels of the original image.

In the second case I really wanted to see what the HD-photo-format could do on the web. A situation where you want a really small file with medium to high details.
I reduced the image to 1024x731 (a bit big for the web, but I really wanted the compression to pop). Compression was set to 10% on the Jpeg and when i matched the resulting file size with HD-photo I got some really interesting results.
Apparently HD-photo has a relatively big compression overhead due to all the increase in the complexity of the format.

It all turned out according to my theory, there simply is no "ultimate" image format, just better or poorer ones for certain usage.

For Microsoft to say:
"It delivers compression quality comparable with JPEG-2000 and more than twice the quality of JPEG."
well I think it at least takes that they have overlaps or equalities in all usage aspects.

My final conclusions are that we're not going to see a shift in the use of standard Jpeg/Gif on the web anytime soon. Although people might start using this format for local storage instead of the usual Jpeg images.

No comments: