Re: Filters (fwd)

MegaZone wrote:
> 
> Once upon a time Chris Wilson shaped the electrons to say...
> !>IE4's 'filter' property was a proposal to the W3C for inclusion in CSS2
> !>before we shipped it in IE.  The placeholder in CSS2 will hopefully (in
> !>my opinion) be replaced by that proposal.  There is obviously still much
> 
> I hope to see it in the final CSS2 also.  It would be nice to have some
> of these effects onhand and not have to script them all out.

It's not so easy, though. Apart from considerations of rendering speed,
code size, interoperability, and "printability" (browsers will have to
have versions of the filters written in Postscript as well), there is
one big question: which filters do we include?

Does there exist a set of primitive image operations that covers 80% of
what people might want to do?

Say I want to blur, vertically compress and apply a rainbow-color to a
piece of text. It would be easiest if I could say something like:

    filter: blur(0.2) scale(1.0, 0.8)
        colorize(left-to-right, violet, blue, green, yellow,
        red);

But none of these filters will help me do a pixelization followed by a
speed-blur.

Including the full set of filters ever made for PhotoShop is clearly no
option. To have any chance that somebody will implement it, it has to be
a small set of basic operations, but not too primitive either.

I've been trying to find a solution without success, maybe somebody can
help?

Just a few of the problems to solve:

  - The examples above only work on the letters, and leave the
    background alone. How do I specify that the background
    should be processed as well?

  - On the screen there is often only just a handful of pixels
    that forms a letter. Any kind of filter will make it
    unreadable. Should there be "hinting" in the filters?

  - If we have filters for visual effects, maybe we need filters
    for audio effects as well?

  - Many interesting effects change the size of the text. When it
    becomes smaller, that is not a problem. But smething like
    "blur" should ideally generate pixels outside the original
    envelope. Is there a way to allow the result of the filter to
    overlap with existing text?

  - What precisely *is* the envelope of a piece of text? It probably
    includes the padding, but does it include the border as well?

  - It is not a big problem if text is in a slightly different
    color than what the style sheet asked for. But for many
    filters, a truecolor display is almost mandatory, and
    dithering will usually not work in the small space that the
    filter is applied to.

  - If a piece of text is broken over two lines, you'll have to
    apply the filter to the two lines separately. For some
    filters that will defeat the purpose.

  - Can you apply filters to images as well?

  - Even to animated GIFs? And to Java applets?

  - Or blinking text?

  - I guess that filters, like text-decoration, will have to work
    on child elements as well. But when the child element has its
    own filter, is that applied first or afterwards?

  - If text overlaps other text (or something else), is that other
    text filtered as well, or is it just the text of the element
    itself?

  - Given that the filters implemented in CSS software will probably
    not produce the same quality as a dedicated tool like PhotoShop
    can deliver, will authors actually use them?

  - And a question to everybody working on CSS software (of any kind):
    do you expect to (be able to) support filters?


Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 93 65 76 92            06902 Sophia Antipolis Cedex, France

Received on Thursday, 6 November 1997 16:24:48 UTC