It's ridiculous that so few websites actually handle this well. Even my own self-written imgur clone does it just fine:
You just have to go into a linear colorspace and use an area filter.
Related, You can get an idea of what your browser display is doing in this shadertoy: https://www.shadertoy.com/view/Wd2yRt
Fwiw, the reason why wikipedis doesn't do this when rescaling images (or at least didn't years ago when i was working on image resizing code for wikipedia) is that to do that (with off the shelf software) required keeping the entire image in memory, which was a big no no. I mean, i guess it would be fine for small images, but then you're using two different algorithms depending on image size, which seems bad.
is it like this? http://www.ericbrasseur.org/gamma.html?i=1
The article links to this browser test page:
http://www.ericbrasseur.org/gamma_dalai_lama.html
On my machine, both Firefox and Chrome display grey rectangles when scaling down. Why do the browsers get this wrong?
Because resizing in a linear colorspace is more costly. JPEG can be resized without shifting colorspaces VERY cheaply, but requires loading into RAM if a change in colorspace (or gamma shift) is performed. The hit can be quite significant. On a phone or laptop it would hurt battery, on an online service (dynamic resizer service) it would impact latency.
> on an online service (dynamic resizer service) it would impact latency.
If its even possible at all. Sometimes users upload things like https://commons.wikimedia.org/wiki/File:“Declaration_of_vict...
Re:Image Scaling Attacks
by choppaface on Thursday October 29, 2020 @12:26PM
(#24932206)
Can also depend on the monitor? When I drag this page between monitors I see different effects.
I have an image I crafted a long time ago which looks something like gray noise when you open it up, but when you downscale it, you see an image of Lt Cmdr Data from Star Trek. I wonder if I can dig it up.
The technique itself was not novel when I did it, a more sophisticated version involving embedded gamma values (which you can make quite large or small) was routinely used on image boards some ten or fifteen years ago.