What is Vignette filter?
The Vignette filter is generally used to focus viewer attention on certain parts of the image without hiding other parts completely. Generally focused part has higher brightness and saturation and brightness and saturation decrease as we go radially out from center to periphery.
Create a vignette filter using Python – OpenCV
In general, Images in computers are stored in the form of a matrix. In case of color image, Image is represented in the form of 3-dimensional matrix or one can say that we use three 2d matrices for representing three color channels one 2d matrix for representing red channel, one for green and one for representing blue. In the case of grayscale image, there exist a single channel so we use a single 2d matrix to represent grayscale images.
Whenever we say kernel or mask, we generally refer to a small size matrix which can be used to apply effects on our image such as blurring, embossing, edge detection, sharpening etc and the process of applying these effect pixel by pixel is known as Convolution.
To imagine how convolution works let’s consider the kernel of size 3×3 and consider the image matrix of size 9×9 as shown. Now we select the 3×3(same size as of kernel) block of pixels in the image matrix and multiply the block selected in the image with our kernel and then take the sum. That sum obtained as a resultant becomes our new pixel value and the position of this pixel value is the central position as shown by the blue color in the diagram. For obtaining the complete filtered image we roll the kernel matrix pixel by pixel over image matrix and carry out this process in the cycle.