Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Point 2 is the most important one, and the most egregious error. Even most browsers implement it wrong (at least the last time I checked, I confirmed it again with Edge).

Here is the most popular article about this problem [1].

Warning: once you start noticing incorrect color blending done in sRGB space, then you will see it everywhere.

[1] http://www.ericbrasseur.org/gamma.html



Browsers (and other tools) can't even agree on the color space for some images, e.g. "Portable" Network Graphics.


Browsers now 'deliberately' do it wrong, because web developers have come to rely on the fact that a 50/50 blend of #000000 and #FFFFFF is #808080


I'm a little bit sympathetic for doing it wrong on gradients (having said that SVG spec has an opt-in to do the interpolation in linear colorspace, and browsers don't implement it). But not for images.


Linear RGB blending also requires >8 bit per channel for the result to avoid noticeable banding.

It is unquestionably superior though.



Did the link go down between when you posted this and now? It now lead to http://suspendeddomain.org/index.php?host=www.ericbrasseur.o...


I imagine that beyond just using linearized srgb using perceptually uniform colorspace such as oklab would bring further improvement. Although I suppose the effect might be somewhat subtle in most real-world images.


For downscaling, I doubt that. If you literally squint your eyes or unfocus your eyes, then colors you see will be mixed in a linear colorspace. It makes sense for downscaling to follow that.

Upscaling is much more difficult.


When image generating AIs first appeared, the color space interpolations were terribly wrong. One could see hue rainbows practically anywhere blending occurred.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: