A C++/GLSL library for enhancing photographs (adjusting brightness, contrast, etc.).
This repository contains the following three features:
- GLSL shaders: Enhancement functionality as shaders for real-time enhancement applications.
- C++ functions: Enhancement functionality as C++ functions for display-less environments.
- Qt Widget: Utility Qt-based widget for easing the use of the GLSL shaders.
- Brightness:
- Apply a gamma curve in the
RGB
space
- Apply a gamma curve in the
- Contrast:
- Apply an S curve in the (gamma-corrected)
RGB
space
- Apply an S curve in the (gamma-corrected)
- Saturation:
- Scale the saturation
- Temperature:
- Add an offset toward the
-U+V
direction in theY'UV
space
- Add an offset toward the
- Tint:
- Add an offset toward the
+U+V
direction in theY'UV
space
- Add an offset toward the
- Lift/Gamma/Gain (9D)
- Reproduce common effects used in many color grading software packages
- Color Balance (3D)
- Adjust the
RGB
values while preserving the lightness
- Adjust the
- GLSL 3.3
- OpenGL 3.2 Core Profile (for Qt features only)
- Eigen (for macOS users,
brew install eigen
; for Ubuntu18.04 users,apt-get install libeigen3-dev
)
- Qt6 (for macOS users,
brew install qt
) or Qt5 (for Ubuntu 18.04 users,apt-get install qt5-default
)
Eigen::Vector3d enhance(const Eigen::Vector3d& input_rgb,
const Eigen::VectorXd& parameters);
where input_rgb
is a 3-dimensional vector ([0, 1]^3), and parameters
is a 5-dimensional vector ([0, 1]^5).
- Sequential Gallery [SIGGRAPH 2020] https://github.com/yuki-koyama/sequential-gallery
- Sequential Line Search [SIGGRAPH 2017] https://github.com/yuki-koyama/sequential-line-search
- SelPh [CHI 2016] https://github.com/yuki-koyama/selph
This library used to have a different procedure to enhance photographs, which was used for some previous publications [Koyama+UIST14; Koyama+CHI16; Koyama+SIGGRAPH17]. The original procedure has color_balance
parameters (3D) instead of temperature
and tint
(2D). Thus, the total number of parameters was 6, not 5.
The color_balance
parameters are for manipulating the chrominance of the input color, which is inherently 2D, and so assigning 3 parameters for this purpose is considered redundant. For example, color_balance = [0.5, 0.5, 0.5]
and color_balance = [0.2, 0.2, 0.2]
result in the same color even though the parameter sets are different.
Thus, the enhancement procedure was updated to use temperature
and tint
instead of color_balance
. These two parameters are popularly used in Adobe Photoshop and Lightroom and so experts are likely to familiar with the concept. These two parameters also appeared in [Kapoor+IJCV14].