A concept for a version of the JPEG XR file format with animation functionality.
What's Animated JPEG XR?
This is a very simple concept encoder and decoder for a proposed "animated JPEG XR" format.
JPEG XR is a neat little image format with some of the following features:
- Fully open and free to implement
- Fully standardised by the ISO and ITU
- Comparable performance to JPEG
- Supports lossless and lossy compression
- Provides superior lossy compression to JPEG
- Supports a very wide range of colour formats
One small and potentially useful feature missing from JPEG XR today is animated support such that can be found in GIF, APNG and WebP. It's my proposal that this feature could be added to JPEG XR very easily.
JPEG XR today already supports storing multiple frames in a single .jxr file, so this aspect of adding animated functionality to JPEG XR requires no work. All that is needed then is to add metadata to JPEG XR files that lets them tell the decoder two things:
- That they are indented to be animated
- What their intended frame rate is
In the JPEG XR file header today there are several reserved bytes that are not used for anything. One of these bytes could be chosen to store both of these needed pieces of information. One bit could say if the file is intended to be animated or not when rendered and the remaining 7 bits could store a number between 1-128 representing the intended playback frame rate in frames per second. Pretty simple.
This project does not implement such a system. Instead the applications that are part of this project create and view files that are actually zip files that store sequences of .jxr files along with a settings file with information regarding the frame rate. I've done this primarily as the .NET imaging libraries do not support storing multiple images in single JPEG XR files, and this implementation is enough to demonstrate the usefulness of the concept.
I've also included some sample .ajxr files to view if you don't happen to feel like encoding your own.
What's so good about this?
Everyone loves animated GIFs. They've become a fairly cherished way of sharing funny short clips around the internet. They can be emailed and posted on image boards in ways that embedded videos and raw video files cannot. Although GIFs are best used for storing graphic files with few colours and little complexity, the vast majority of animated GIFs are used for sharing videos. It's not hard to do better than this.. Animated JPEG XR can store animated videos miles better than GIF can today and it also has the advantage of being able to store crisp graphics just as well using lossless mode. Animated JPEG XR files could prove more suitable for animated graphical elements than GIF as, like APNG, it had full opacity support. Pretty neat.
Better still, animated JPEG XR files degrade gracefully to open with JPEG XR decoders that don't know about animated JPEG XR. Much in the same way APNG opens in applications that don't support animated PNG and only the first frame is displayed.
Perhaps not the most useful thing in the world, but given the extremely low amount of effort needed to enable this scenario I would argue it's worth someone trying out. Currently Microsoft's Internet Explorer is the only browser to support JPEG XR so far. If the format ever gains more popularity than that on the web is anyone's guess, but for anyone considering using this format on the web, I believe the addition of animation support is a worth while addition to the standard.