Re:How Discord Resizes 150M Images Every Day with Go and C++
by malux85 on Tuesday November 14, 2017 @01:34PM
(#15697826)
agree on 3) most browsers just use linear interpolation when resizing images, which makes sense from a performance point of view, but looks terrible.
Better to use a bi-linear or cubic resize, more computing up front, but better images, this is probably the reason they do it
[ Parent
| on HN ]
Re:How Discord Resizes 150M Images Every Day with Go and C++
by amelius on Tuesday November 14, 2017 @02:55PM
(#15698547)
But soon you can do any type of resizing through WASM on the browser.
Re:How Discord Resizes 150M Images Every Day with Go and C++
by XCSme on Tuesday November 14, 2017 @04:03PM
(#15699092)
You can already do it, just use a library or implement your own scaling function and don't use the built-in image resize functions.
Re:How Discord Resizes 150M Images Every Day with Go and C++
by searealist on Tuesday November 14, 2017 @11:24PM
(#15701441)
bi-linear is linear interpolation
Re:How Discord Resizes 150M Images Every Day with Go and C++
by nice_byte on Wednesday November 15, 2017 @01:44AM
(#15701900)
I think they may have meant "nearest-neighbor", which isn't true for any browsers that I know of.
Regardless, there are still better filters than bilinear, i.e. Lanczos, which I'm pretty sure none of the browsers use.
Re:How Discord Resizes 150M Images Every Day with Go and C++
by trumpeta on Tuesday November 14, 2017 @04:39PM
(#15699415)
This is my understanding as well, you could kill a browser trying to do single-threaded bilinear or cubic resize on a sufficiently large image.
Re:How Discord Resizes 150M Images Every Day with Go and C++
by Poefke on Wednesday November 15, 2017 @07:03AM
(#15703160)
If you resize the image in steps, with each resize at least 50% of the previous step, you can do a pretty decent approximation of cubic resize using the canvas. Doing this for a year now, we've gotten no complaints and we have designers as clients :)