Live data from Hacker News

What every coder should know about gamma (2016)

blog.johnnovak.net

21–30 of 50 posts

Re: What every coder should know about gamma (2016)

#21

> [...] the only reason to use gamma encoding for digital images is because it allows us to store images more efficiently on a limited bit-length [...] It's interesting how this part of the trade-off changes when using float16 for color components (as is common when HDR is involved) rather uint8. Good timing that Safari 27 adds support for srgb-linear and display-p3-linear color spaces.

[dead]

Re: What every coder should know about gamma (2016)

#23
post #18
post #7

for lot of image processing linearizing srgb is only half-way measure, and you might want to reach for a better colorspace altogether. cielab is obvious example, or maybe oklab/jzazbz/xyb/something else.

Depends. Many times a linear colorspace is exactly what you want.

Linear light, or linear perceptual?

Re: What every coder should know about gamma (2016)

#24
post #19

This article contains some pretty major errors, which is kind of surprising to see! >The transformation used to represent the physically linear intensity data either generated synthetically via an algorithm or captured by a linear device (such as a CMOS of a digital camera or a scanner) with the discrete values of the perceptually linear scale is called gamma encoding. This isn't super correct, and it underscores the…

When antialiasing, I think you do want to model light: a fully black object occluding 40% of a pixel should cause it to emit 40% less light. Linear intensity representations of colour should therefore be used.

When doing a smooth fade-to-black in video, you may want to gradually decrease the amount of emitted light from the whole frame in a way that is smooth to a human. Here I think you should consider how a perceptual space can help.

Re: What every coder should know about gamma (2016)

#25
I work on the open-sourced Jedi Academy game engine, which is based on id tech 3. It has special logic to specifically adjust the gamma of the physical monitor during launch, then restore it upon exit.

This is why when these older games crashed on your PC, the monitor would look all washed out due to the manual gamma adjustments the game made that didn't get restored.

Re: What every coder should know about gamma (2016)

#26
For those interested in this topic, I found minutephysics' treatment of this subject to be really pleasant and easy to grok. I had a talk I gave at work once or twice discussing color conversion and I would play a 90 second snippet from this (attributed appropriately) as it would very quickly crash course people on the reasoning behind an EOTF in a really cute and layman's terms kind of way:

https://www.youtube.com/watch?v=LKnqECcg6Gw

Re: What every coder should know about gamma (2016)

#27

I work on the open-sourced Jedi Academy game engine, which is based on id tech 3. It has special logic to specifically adjust the gamma of the physical monitor during launch, then restore it upon exit. This is why when these older games crashed on your PC, the monitor would look all washed out due to the manual gamma adjustments the game made that didn't get restored.

Nice! I remember being an early Nvidia adopter (RIVA 128, TNT) when all of my fellow LAN party buddies were Voodoo users, and I had to download a custom opengl32.dll which actually adjusted the gamma into tolerable levels so you could see what was going on in Quake.

Re: What every coder should know about gamma (2016)

#29

I work on the open-sourced Jedi Academy game engine, which is based on id tech 3. It has special logic to specifically adjust the gamma of the physical monitor during launch, then restore it upon exit. This is why when these older games crashed on your PC, the monitor would look all washed out due to the manual gamma adjustments the game made that didn't get restored.

This kind of thing is why you need a separate watchdog process that gets notified when the other process terminates.

Re: What every coder should know about gamma (2016)

#30
post #9
post #3

Earlier quoted context omitted.

> or one where 0 is not no light Oh, interesting. What's an example of this? Some sort of log space?

I would think the color spaces of most displays have that, don’t they? The bevel of a black iPhone is darker than its screen, even when powered off. Similarly, switched off CRT displays aren’t truly black.

That isn't light emission, though.
Post reply on HN