5 ms·
The fact we still have botched gamma compositing and scaling is one of my personal grievances. In 3D graphics people have mostly learned to use linear light spa
by BulgarianIdiot 3y ago
The fact we still have botched gamma compositing and scaling is one of my personal grievances. In 3D graphics people have mostly learned to use linear light space as otherwise lighting is really wrong, the more the simulation resembles how light really works.
But in, say, Photoshop the gamma is still wrong, unless you switch to 32-bit space, which produces huge files and removes access to most filters. You don't need 32-bit precision for proper gamma. You just need gamma correction when combining/interpolating/blending color values. Alas. Ignorance is pervasive.
- BulgarianIdiot 3y agoBTW, I was a beta tester of Photoshop at Adobe like 20 years ago and I kept pestering them about it. None of the engineers there, including tenured "fellows" could comprehend the problem. Extremely aggravating.
- d_tr 3y agoIt sounds crappy anyway but, maybe they just did not care? Or the code was a mess and it would be a hassle to implement? I find it really hard to believe that people at freaking Adobe would be unable to comprehend this...
- BulgarianIdiot 3y agoWell sure, many were aware of gamma correction, but everyone's so used with how incorrect compositing looks, that it works "fine" in their mind. And being aware of gamma doesn't mean you truly grok the extent of visual corruption that spreads in images while compositing, scaling, editing etc. I heard explanations how it'd be slow, or doesn't matter, or what am I talking about, all ultimately variations of "works as coded, won't fix". There are clearly people at Adobe who are aware of the issue in some capacity, and their efforts have weird specifics, such as... they noticed text anti-aliasing looks weird, so they added an Advanced Control called "Blend Text Colors Using Gamma" option in Color Settings. The bizarre thing is that none of this is specific to text. It's just that text has many small complex shape edges, and you notice it more on text (like Carmack noticed it on the star field). They didn't fix vector art rendering, for example. And the option default is not even the correct gamma for a document, but 1.45 which makes no sense at all. They just "eyed it" and went with it. There's also a Blend RGB Colors Using Gamma option which is disabled by default. If you enable it, it corrects SOME operations, but not others, with no rhyme or reason. However, you can't really tweak those yourself, because if you do, the settings are not saved per document, they're global. So if you tweak them... then ALL Photoshop files you open will look wrong, because they were originally made for another configuration of these settings. Which leaves you with 32-bit color channels. I have Actions that convert an image to 32-bit to scale, and back to 8/16-bit, just so it's gamma corrected. It's... a f***ing mess.
- meindnoch 3y agoJohn Novak proposes a different hypothesis for Photoshop's choice of gamma=1.42 in text antialiasing: "Photoshop antialiases text using γ=1.42 by default, and this indeed seems to yield the best looking results (middle image). The reason for this is that most fonts have been designed for gamma-incorrect font rasterizers, hence if you use linear space (correctly), then the fonts will look thinner than they should." https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/ https://blog.johnnovak.net/2016/09/21/what-every-coder-shoul...
- leni536 3y agoFonts designed with incorrect gamma rendering also assume specific colors for foreground and background. With incorrect gamma the stems get thicker when rendered black on a white background, and thinner with inverse colors. So even if a font is designed with incorrect gamma, it might still not be the best to render it with incorrect gamma, as you might use different background and foreground colors to the designer of the font. AFAIK freetype has the option to enable "stem thickening" to consistently correct for incorrectly designed fonts regardless of colors being used for rendering.
- orbital-decay 3y agoIt's not hard to believe, as Photoshop is often broken and is known for massively janky workarounds. Adobe consistently ignores basic features improvement in Photoshop, from the outside it seems like a business decision. Most of the work is redirected into their other products (new brush engine in Fresco, Speedgrade color processing integration into Premiere etc).
- turnsout 3y agoI was also a PS beta tester around that time, and prominent testers such as Stu Maschwitz were actively pushing the PS and After Effects teams to incorporate linear light compositing. Stu was able to get linear compositing into AE, but I think PS had already evolved into more of a graphics tool than a photo tool. They added 32bpcc and HDR, but it's for specialty workflows, not general use. Fully embracing linear light would change almost every part of PS—everything from blend modes to the built-in filters were written for perceptually encoded values that don't go over 1.0. Even today, Curves works with 32bpcc, but only shows you the 0–1 portion.
- PaulHoule 3y agoI do image processing with Pillow and it was obvious to me that things didn’t look right unless I did the math with linear light so I did.
- sporf 3y agoSimilar experience at the fruit company ~15 years ago designing a graphics scaling and compositing pipeline for one of the earlier high volume phone SoCs. It was originally designed with (de)gamma blocks before/after the scaling and compositing blocks to do it in linear space but the (de)gamma blocks were removed at the request of a graphics team because "nobody does that" - I recall the justification being that their assets were optimized for the incorrect behavior so they preferred it. I had a copy of Jim Blinn's book Dirty Pixels (aka the Gammasutra) that I would refer people to but it didn't change any minds. I hope they've improved since.
- astrange 3y agoDon't know why I remember this, but the iOS 7 icon for Voice Memos was a good demonstration of doing scaling wrong. It had a lot of fine detail so the gamma-incorrect scaling made for some obvious twinkling effects in zoom effects.
- Akronymus 3y agoThat, and using linear slider fraction of max volume are some of the biggest pet peeves for me.
- Negitivefrags 3y agoThere is a setting in photoshop for this. It’s called something like “Blend in Gamma: 1.0”. The default is 2.2 of course. The annoying thing is that it can’t be done per image, so if you chnage it, it breaks the blending of any image you load made by someone who doesn’t have that setting enabled. I occassionally walk around our studio and audit this setting is set correctly for all our VFX artists because they are the ones who will see incorrect results compared to in-engine if they use the wrong setting here.