The Flash Player Incubator builds on labs.adobe.com contain a capability which is the result of some of the Molehill work I have done. When we looked at how to support textures for Molehill I immediately faced the issue of having to deal with inadequate image formats.
Traditional JPEGs are simply not flexible enough. They lack transparency support and suffer from low quality. Most encoders use 4:2:0 chroma sampling and the most commonly used implementation is based on outdated reference source code which does not leverage modern compression techniques. PNGs tend to have their own share of issues, specifically they tend to be rather bad for photographic and noisy content.
JPEG XR to the rescue. JPEG XR is a completely free specification, provided by Microsoft with the Microsoft Open Specification Promise. It has been standardized as ITU T.283 and comes with fairly good reference source code. Why is JPEG XR so cool?
- It supports lossy compression of alpha channels.
- It supports true lossless compression when needed.
- It has better quality than JPEG in most cases.
- Computationally and complexity wise it is much lighter weight than JPEG-2000.
- It supports floating point formats.
- It only supports one color space, the only one which matters on the web: sRGB (in video terms that is BT.709).
- It supports RGB555 and RGB565 color models which is important for block compressed Molehill textures.
- It’s completely open as mentioned above.
Particularly the chroma sampling issues with most available JPEG encoders are a pretty big problem for me and certainly for many designers. Let me show what I mean, here is an image compressed with 4:2:0 on the left and one with 4:4:4 on the right, notice the washed out red (Did you know that in Fireworks 4:4:4 chroma sampling kicks in only around 86 in the JPEG compression quality settings?):
So what does that mean for the Flash Player? Though I added JPEG XR primarily for Molehill texture support you can load any JPEG XR image like you load PNG or JPEG files in the Flash Player today (if you mark your SWF as version 13).
IE9 also has native JPEG XR support. Here is a nice comparison of the quality improvements you can get with JPEG XR compared to JPEG.
Bandwidth is still important and reducing the size of assets is particularly key if you do something like games which rely on huge amounts of them. Does that mean that PNGs and JPEGs are obsolete? Not by any means. That’s especially the case for PNG. PNG does extremely well on synthetic/flat content and will beat both JPEG and JPEG XR at any time with that type of content.