W3C home > Mailing lists > Public > public-webfonts-wg@w3.org > July 2010

Losslessness

From: Chris Lilley <chris@w3.org>
Date: Tue, 27 Jul 2010 22:08:53 +0200
Message-ID: <1148503904.20100727220853@w3.org>
To: public-webfonts-wg@w3.org
Hello public-webfonts-wg,

Looking over ISSUE-5
Attempt to define the boundaries of WOFF's losslessness clearly e.g. Chrome's OTS edits are out o scope

reminded me of a similar situation we faced with the PNG spec, which also found it necessary to define what 'lossless' meant. It may be helpful if I describe what we did there, by way of an illustrative example.

At first it seemed obvious and trivial. GIF was restricted to 8 bit indexed colors and binary (on/off) transparency, while PNG could have 8 bit indexed, 24 bit, 48 bit colour; and any level of transparency including  fully on and fully off. Ergo, any GIF image could be losslessly represented in PNG. (This was in 1994, before GIF animation was developed). Any colour at any pixel position could be losslessly encoded.

But then people asked about TIFF; was a conversion to PNG lossless as well? Sure, for a 24 or 48 bit RGB TIFF; no, for a CMYK TIFF.

And then consider two GIF images, identical in their actual colours, but differing in the order in which colours were allocated in the pallette. They would give the same visual result, but the data in the palette would differ. Indeed one could code little messages into the palette - let black be the letter 'a', and white be the letter 'b', and .... would PNG losslessly preserve that secret message? No. (One could imageine similar secret messages in sfnt formats, for example by assigning meaning to variable amounts of padding ....)

So PNG defined a 'reference image' - a theoretical RGBA image with 16 bits for each of red, green, blue and alpha. Any RGB image, indexed or truecolour, can be converted to that form of image. PNG then states that the conversion from the reference image, to a PNG encoded image, and decoding back to another reference image, is lossless. Ancillary information, such as creation date, colour profiles, comments, are not represented in the reference image sand PNG is not defined to be 'lossless' there. (Although it can hold such things).

I wonder if a similar concept (a normalised sfnt subset?) could be of use when considering how WOFF is 'lossless', or in other words, what information is guaranteed to be bit-for-bit preserved and what is not guaranteed (even if it is, in fact, preserved).

-- 
 Chris Lilley                    mailto:chris@w3.org
 Technical Director, Interaction Domain
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG
Received on Tuesday, 27 July 2010 20:09:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 July 2010 20:09:45 GMT