W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2011

[whatwg] Canvas 2D context proposal: point/linear filtering modes

From: Ashley Gullen <ashley@scirra.com>
Date: Sat, 29 Oct 2011 03:17:44 +0100
Message-ID: <4EAB6248.8080101@scirra.com>
On 29/10/2011 02:15, Boris Zbarsky wrote:
> On 10/28/11 3:26 PM, Ashley Gullen wrote:
>> Overall, I think this proposal is very simple, straightforward to
>> standardise and implement, genuinely useful, and would significantly
>> encourage 2D gaming in HTML5 for comparitively little effort. Is it
>> possible that this could be included in the standard? Any
>> comments/suggestions/vendor-specific extensions I've missed?
> There is experimental support for this in Gecko at the moment via the 
> boolean mozImageSmoothingEnabled property on the 2d context.  At the 
> time this was added there was talk about getting more feedback from 
> this group; not sure whether that ever happened.
> I would be curious to know whether this property solves your use cases.
> I do think we should add some capabilities to at least force 
> nearest-neighbor interpolation; this is a commonly requested feature.
> -Boris

I had a quick go with setting ctx.mozImageSmoothingEnabled = false.  It 
works great with drawImage.  However it does not appear to affect 
repeated patterns.  This makes for quite a strange effect where the 
game's sprites are pixellated but the tiled backgrounds are bilinear 
filtered.  So it's half way there.

Do any other browsers have vendor-specific switches for this?  That 
would be a good workaround for the time being.

Ashley Gullen
Received on Friday, 28 October 2011 19:17:44 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:37 UTC