W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2013

Re: [whatwg] Bicubic filtering on context.drawImage

From: Oliver Hunt <oliver@apple.com>
Date: Mon, 09 Dec 2013 13:15:00 -0800
Message-id: <E03C1F12-6096-4280-8CCD-673E4536ED74@apple.com>
To: Jeff Muizelaar <jmuizelaar@mozilla.com>
Cc: What WG WG <whatwg@lists.whatwg.org>, Glenn Maynard <glenn@zewt.org>, Tingan Ho <tingan@p1.cn>, Rik Cabanier <cabanier@gmail.com>, "Tab Atkins Jr." <jackalmage@gmail.com>

On Dec 9, 2013, at 2:29 PM, Tingan Ho <tingan@p1.cn> wrote:

>> Tingan, would it be acceptable for you to do the resampling in JavaScript?
> First, writing it in Javascript is less performant. Since natively you can
> have access to the GPU. Second, it is abstract a layer for JS developers,
> since they don't need to care about bicubic resampling algoritmen. Third,
> it kind of make sense if you set imageSmothingEnabled to true in the
> context object, that all down-scaling should use bicubic resampling(I
> haven't tried yet, but I think the scale use bicubic sampling).

I’m not sure why you have a bias towards bicubic filtering as there are
many different scaling filters that can be used.

Lanczos is better than bicubic in many (most?) cases.  Spline scaling
can also do a good job, as can fractal interpolation.

There are even specific scaling systems like Sal which are designed for
upscaling sprites, and do a better job at the specific task than anything 
else (IIRC this is frequently used by the various old console emulators)

Received on Monday, 9 December 2013 21:15:28 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:14 UTC