-
Color inversion
We have access to each of the colors of the render output so it's not so hard to return the inverse of these colors in the fragment shader. We take the color of the screen texture and inverse it by subtracting it from 1.0: -
Grayscale conversion
We remove all colors from the scene except the white, gray and black colors; effectively grayscaling the entire image. This is done by taking all the color components and averaging their results -
Edge detection
For this we use a kernel(or convulation matrix) which multiplies the surrounding pixels by several weights determined in the kernel and balances the result by multiplying the current pixel by a large negative weight.
This kernel highlights all edges and darkens the rest, which is pretty useful when we only care about edges in an image. -
Gamma correction
The idea of gamma correction is to apply the inverse of the monitor's gamma to the final output color before displaying to the monitor.We multiply each of the linear output colors by the inverse gamma curve (making them brighter) and as soon as the colors are displayed on the monitor, the monitor's gamma curve is applied and the resulting colors become linear. We effectively brighten the intermediate colors so that as soon as the monitor darkens them, it balances all out.
sudo apt-get install cmake pkg-config
sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install libglew-dev libglfw3-dev libglm-dev
sudo apt-get install libao-dev libmpg123-dev
- Clone the repository
git clone https://github.com/KunalA18/IP-openGL.git
- Build files and test
cd IP-openGL
cd build
cmake ../src
make
cd ../bin
./working
Color Inversion | Grayscale conversion |
---|---|
Edge detection | Gamma correction |
---|---|