Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Alpha compositing
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Gamma correction == [[File:Mix lazy.png|thumb|Alpha blending, not taking into account gamma correction]] [[File:Mix precise.png|thumb|Alpha blending, taking<br> into account gamma correction]] The RGB values of typical digital images do not directly correspond to the physical light intensities, but are rather compressed by a [[gamma correction]] function: : <math>C_\text{encoded} = C_\text{linear}^{1/\gamma}</math> This transformation better utilizes the limited number of bits in the encoded image by choosing <math>\gamma</math> that better matches the non-linear human perception of luminance. Accordingly, computer programs that deal with such images must decode the RGB values into a linear space (by undoing the gamma-compression), blend the linear light intensities, and re-apply the gamma compression to the result:<ref>{{cite web|url=https://www.youtube.com/watch?v=LKnqECcg6Gw| archive-url=https://ghostarchive.org/varchive/youtube/20211122/LKnqECcg6Gw| archive-date=2021-11-22 | url-status=live|title=Computer Color is Broken|author=Minute Physics|date=March 20, 2015|website=[[YouTube]]}}{{cbignore}}</ref><ref>{{cite web |title=What every coder should know about gamma |url=https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/ |last=Novak|first=John|date=September 21, 2016}}</ref>{{Failed verification|date=October 2022}} :''<math id="C_o = \left(\frac{ C_a^\gamma \alpha_a + C_b^\gamma \alpha_b (1 - \alpha_a) }{\alpha_o}\right)^{1/…" qid="Q281055">C_o = \left(\frac{ C_a^\gamma \alpha_a + C_b^\gamma \alpha_b (1 - \alpha_a) }{\alpha_o}\right)^{1/\gamma}</math>'' When combined with premultiplied alpha, pre-multiplication is done in linear space, prior to gamma compression.<ref>{{cite web |title=Gamma Correction vs. Premultiplied Pixels – Søren Sandmann Pedersen |url=http://ssp.impulsetrain.com/gamma-premult.html |website=ssp.impulsetrain.com}}</ref> This results in the following formula: :<math>C_o = \left( C_a^\gamma + C_b^\gamma (1 - \alpha_a) \right)^{1/\gamma}</math> Note that the alpha channel may or may not undergo gamma-correction, even when the color channels do.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Alpha compositing
(section)
Add topic