W3C home > Mailing lists > Public > public-fx@w3.org > October to December 2010

Re: [css3-images] image-rendering property for contrast-preserving image upscaling

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 1 Dec 2010 15:39:50 -0800
Message-ID: <AANLkTimZ6haRza0XcOpvXD_Md+0mViFxtJtw8WJYaAD0@mail.gmail.com>
To: James Robinson <jamesr@google.com>
Cc: www-style list <www-style@w3.org>, public-fx@w3.org
On Wed, Dec 1, 2010 at 3:25 PM, James Robinson <jamesr@google.com> wrote:
> I propose that CSS adopt something similar to the Mozilla property
> with the possible values 'auto' and 'optimize-contrast'.  The property
> could apply to images, background-images of any element, HTML5
> <video> and HTML5 <canvas> (just like the mozilla version).  A user
> agent could use nearest-neighbor or (in theory) a more sophisticated
> pixel art scaling algorithm
> (http://en.wikipedia.org/wiki/Pixel_art_scaling_algorithms) for
> 'optimize-contrast' images and their normal scaling algorithms for
> 'auto' images.  Alternately, we could just say that optimize-contrast
> means nearest neighbor and leave it at that since I don't anticipate
> that anybody will actually implement any other scaling algorithms.

Really?  On modern hardware you should be able to use EPX liberally,
particularly for <img>.  I'd leave it loose so browsers could choose
to do prettier scaling if they want.

On that note, if we're wanting to just give two basic intent options
here - optimize smoothness or optimize contrast, we can name things
more accurately.  Something like "image-scaling-intent: smooth |
sharp".  Then it's clear what the author is asking for, so a browser
can make a good choice; in the "smooth" case, using nearest-neighbor
in the degenerate case, bilinear in the common, lanczos when they
determine they can afford it, etc., while in the "sharp" case the
browser can use nearest-neighbor at the bottom, upgrading to EPX or
similar as it determines it to be possible.

~TJ
Received on Wednesday, 1 December 2010 23:42:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 December 2010 23:42:32 GMT