Re: Turning image interpolation off.

On Mon, Nov 11, 2013 at 5:18 PM, Paul LeBeau <paul.lebeau@gmail.com> wrote:
> While attempting to write a test case for my implementation of
> <feConvolveMatrix>, I was wanting to display an image without any
> filtering/interpolation.
>
> <?xml version="1.0" encoding="utf-8"?>
> <svg xmlns="http://www.w3.org/2000/svg"
> xmlns:xlink="http://www.w3.org/1999/xlink"
>      width="100%" height="100%" viewBox="0 0 17 17" >
>
>   <defs>
>     <filter id="test1" filterRes="3" x="0" y="0" width="1" height="1">
>       <feConvolveMatrix order="3" kernelMatrix="0.5 0.5 0.5 0.5 3 0.5 0.5
> 0.5 0.5"/>
>     </filter>
>
>   </defs>
>
>   <image x="7" y="2" width="3" height="3" xlink:href="swatch3x3.png"
> filter="url(#test1)"/>
>
> </svg>
>
>
> Unfortunately, all the browsers (WK/FF/IE) interpolate even when
> image-rendering="optimizeSpeed" is applied.
>
> After a bit of research, I gather that some browsers supported (past-tense)
> an "optimize-contrast" option for "image-rendering". What happened to that?
>
> In any case, should there be a way to force non-interpolated rendering?

The 'image-rendering' property is now defined by CSS:
<http://dev.w3.org/csswg/css-images/#the-image-rendering>  In
particular, you want the value "image-rendering: pixelated;".

I'm not sure what the browser support is for this yet.

~TJ

Received on Tuesday, 12 November 2013 01:55:30 UTC