Gamma correction
lastmod 2023-11-29created 2016-02-1315 edits
Gamma correction refers to nonlinearly transforming a light intensity signal using a nonlinear transfer function in video cameras, computer graphics, and so on. The term gamma correction is widely used, but in most cases the expression gamma encoding is more appropriate.
Fine-tuning the gamma value according to the characteristics of a display and the like is gamma adjustment, which is a different concept from gamma correction
Brightness/contrast adjustment
- [Recommended] (OpenCV) Image brightness/contrast, histogram
- [Recommended] OpenCV - Adjusting image brightness/contrast - Lucathree log
- (Python OpenCV) Adjusting image brightness - cv2.add, np.clip
How results change depending on the brightness adjustment method
Excerpt from the ddrm project:
with self.layer(f"{prefix}-channels-bgr") as layer:
layer.frame = image.copy()
with self.layer(f"{prefix}-channels-v") as layer:
hsv = cvt_color_BGR2HSV(image)
v = hsv[:, :, 2]
layer.frame = v
with self.layer(f"{prefix}-channels-gray") as layer:
v = cvt_color_BGR2GRAY(image)
layer.frame = v
with self.layer(f"{prefix}-channels-sum") as layer:
v = image.sum(axis=2)
v = (v / (255 * 3) * 255).astype(uint8)
layer.frame = v
| | | | |
| Original BGR | HSV - Value channel | Gray | Channels Sum |
See also
- Image processing
- Color grading - (color correction)
- Python:colorsys - Python sample code for gamma correction
- Brightness - Value