Dark part: it is the value close to 0 in RGB 0.
Intermediate Value: the value in-025 of RGB.
Highlight: the value close to 255 in RGB 0.
RGB and YUV are both color spaces and can be converted to each other. YUV (also called ycrcb) is a color encoding method used by European TV systems, YUV is mainly used to optimize the transmission of color-electric video signals. Its advantage is that the transmission consumes less bandwidth, and y in YUV indicates the brightness, which is a gray level and a base band signal, u and v represent the color, which is used to describe the color and saturation of the image.
The brightness of Y is determined by RGB input, by overlapping specific RGB parts. The color defines two aspects (tone and saturation), which are expressed by Cr and CB, respectively, cr reflects the difference between the red part of the RGB input signal and the brightness part of the RGB signal, while CB reflects the difference between the blue part of the RGB input signal and the RGB brightness. Conversion between RGB and YUV:
YUV <--> RGB
Y' = 0.299 * R' + 0.587 * G' + 0.114 * B'
U' =-0.147 * R'-0.289 * G' + 0.436 * B '= 0.492 * (B'-y ')
V '= 0.615 * R'-0.515 * G'-0.100 * B' = 0.877 * (R'-y ')
R' = y' + 1.140 * V'
G' = y'-0.394 * U'-0.581 * V'
B '= y' + 2.032 * U'
YCbCr <--> RGB
Y' = 0.257 * R' + 0.504 * G' + 0.098 * B '+ 16
CB '=-0.148 * R'-0.291 * G' + 0.439 * B' + 128
Cr '= 0.439 * R'-0.368 * G'-0.071 * B' + 128
R' = 1.164 * (y'-16) + 1.596 * (CR '-128)
G' = 1.164 * (y '-16)-0.813*(CR'-128)-0.392 * (CB '-128)
B '= 1.164 * (y'-16) + 2.017 * (CB'-128)
Note: The above symbols all carry an apostrophes, indicating that the symbol performs Gamma Correction Based on the original value.
The preceding parameters may have different precision in different places.
HSV: