W3C home > Mailing lists > Public > www-svg@w3.org > November 2013

Re: Turning image interpolation off.

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 11 Nov 2013 17:54:43 -0800
Message-ID: <CAAWBYDA7U=B4gxMxiCqmTez54pT+u=uAtT+7POFWTpTvHhZ-2Q@mail.gmail.com>
To: Paul LeBeau <paul.lebeau@gmail.com>
Cc: www-svg <www-svg@w3.org>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:34 UTC