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

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
Scirra.com

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