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

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:40:44 UTC