Understanding RGB Color, and Gamma

Understanding RGB Color, and Gamma

It is a long page. First the color systems, and then the details of RGB below.

There are other color systems, but two of the basic color systems are:

  • RGB (Red, Green, Blue, Wikipedia) is called the Additive system of light itself (for example, as transmitted from computer monitors and television sets). Our eye sees the light directly transmitted from the source.
  • CMYK (Cyan, Magenta, Yellow, Key, Wikipedia) is called the Subtractive system as reflected from pigments (for example, seen after reflection from a surface, such as from painting, printing or photo prints). We see the light reflected from the surface after the pigment color has absorbed some colors of it.

This article is about RGB color, which is universally used in our digital cameras and scanners, almost all photo image files, computers, video monitors, cell phones, television and computer screens, stage lighting, and about anything else working with light (and our human eyes are a RGB system too). We view light transmitted directly from the source. Raw files are not yet exactly RGB yet, but raw files are also not viewable images yet, not until the RGB conversion that we can view. See more RGB specifics below.

 

RGB Specifics

This image of RGB colors just tries to show some examples of basic concepts of the RGB numbering nomenclature. There are many possible shades of a color, using slight numeric differences. Don't worry if the numeric values seem difficult to predict, some of them certainly can be. A little experience helps some, but typically only web page work needs to know much detail. And in practice, it's easy, as there are many web references to help, and for use on web pages, we can simply look up the proper codes for the desired color. There's also a color picker from Mozilla to play with to match the colors to the numbers. The Adobe Photoshop or Elements Color Pickers are a similar tool.

Each of the individual R or G or B components are normally 8-bit values, each in the range of [0..255], because 255 is the largest value possible to store in 8 bits (28 = 256 values of [0..255]). One image pixel's color is a combination of the three R,G,B basic components (then called 24-bit color). For example, we know from grade school that red and green make yellow. Later in science we learned White light is a mix of all colors. Numbers up toward 255 are bright, and down near zero are dark or black.

Speaking of only the Red to add comments about what it shows. Green and Blue are the same.  数值越大颜色越亮

  • Red is shown as RGB(255,0,0) which is the brightest possible red.
  • Lighter red is a shift towards white, which pure white is RGB(255,255,255). So this arbitrarily adds 150 equally in the other two Green and Blue channels, to shift towards white, which is then RGB(255,150,150) or lighter red. Equal G and B will not add a color cast.  浅红色
  • Darker red is just less intensity than 255, so RGB(150,0,0) is one example.  深红色,从255的亮红色,到155的暗红色。
  • Cyan is the inverse of red, and the inverse value is (255 - the color), so Cyan comes out RGB(0,255,255)

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(84)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2021-11-19 2021年上海市成人高校招生最低录取控制分数线
2020-11-19 Install and manage packages in Visual Studio using the NuGet Package Manager
2020-11-19 How to check the version of an assembly (dll)?
2020-11-19 RSACryptoServiceProvider.FromXmlString
2014-11-19 炉石相关的开源
点击右上角即可分享
微信分享提示