News for hackers. Stuff that matters.
Re:Towards richer colors on the Web by danwills on Saturday July 03, 2021 @02:52AM (#27719866)
In VFX for film, color is a huge issue too. What companies mostly do is to try to use a 'linear-to-light' color-space internally, pre-linearizing turned-over footage before working with it, and then post-transforming the final composites either back to the original colour space, or something similar. Doing this allows images to be freely filtered, resized, defocused, color-corrected etc whilst within the pipeline without it creating incorrect results because of non-linear color.

Kinda seems like it might be quite nice in a web/css world to be able to similarly work in some kind of fairly neutral 'linear' color-space in the code, and let the platform and hardware translate that as well as it can?

Re:Towards richer colors on the Web by scq on Saturday July 03, 2021 @08:11AM (#27721079)
This is also how modern game engines work. Textures are converted to linear space and all rendering is done in linear space before being converted to sRGB for display at the end.

Not doing so results in weird looking shading, which has a very 90s/early 2000s feel about it.

Re:Towards richer colors on the Web by Cullinet on Saturday July 03, 2021 @04:54AM (#27720286)
Re:Towards richer colors on the Web by danwills on Saturday July 03, 2021 @05:33PM (#27725095)
Yeah totally! Some of the ideas from openEXR seem like they could help a lot here! Of course there's nothing stopping ppl from storing not-linear pixel values in whatever color space you like in an exr file, but at least the format can do a reasonable job of recording metadata about this, so that it can still hopefully still be linearized on load.

I think it's worth noting here that linearizing-after-load is often not good enough, since the renderer most often has already automatically filtered (think MIP pyramid/etc) the texture values by the time you get hold of them. You always want the values in a linear color space (gamma=1.0) during filtering. Some renderers try to support this so you can load a jpeg without thinking about it too hard but myself I would prefer to include an explicit linearization step for extra control and peace of mind. You may end up wanting to use a specific LUT to linearize with for example, and the errors that creep in if gamma is not 1.0 can be quite subtle and hard to put your finger on, but can really sap photorealism in a nasty way.

Re:Towards richer colors on the Web by joshu on Saturday July 03, 2021 @04:01AM (#27720084)
Any good tutorials or beginner articles about this?
Re:Towards richer colors on the Web by krono on Saturday July 03, 2021 @05:15AM (#27720367)
Someone posted this cool little tool[1][2] on Reddit a while back (no affiliation). It colour grades an image you upload based on a scene you select from their gallery.

Not really what you asked for but it helped me understand how massive of an impact colour grading can have on how you perceive a scene.

1 https://match.color.io/

2 https://v.redd.it/113ksxlphgz61/DASH_720.mp4

Re:Towards richer colors on the Web by dannyw on Saturday July 03, 2021 @05:33AM (#27720429)
Very cool tool but how is this colour grading? It looks like cheap instagram filters.
Re:Towards richer colors on the Web by danwills on Saturday July 03, 2021 @05:36PM (#27725114)
I think this might be because a large part of what Instagram filters do /is/ just color grading.
Re:Towards richer colors on the Web by danwills on Saturday July 03, 2021 @05:08PM (#27724936)
I found this:

https://developer.nvidia.com/gpugems/gpugems3/part-iv-image-...

This is about working with linear-to-light values on GPUs however the issues in VFX are largely the same.

Re:Towards richer colors on the Web by scq on Saturday July 03, 2021 @08:13AM (#27721092)