(Note:- If you feel that this task has improved your abilities, don't forget to click the star icon in the upper right.)
- We need to read the image in RBG format and then convert it to a grayscale image. This will turn an image into a classic black and white photo. Then the next thing to do is invert the grayscale image also called negative image, this will be our inverted grayscale image. Inversion can be used to enhance details.
- Then we can finally create the pencil sketch by mixing the grayscale image with the inverted blurry image.
- This can be done by dividing the grayscale image by the inverted blurry image. Since images are just arrays, we can easily do this programmatically using the divide function from the cv2 library in Python.
Reading the image in RGB format and converting it to a grayscale image using CV2 library from python, matplotlib, style cvtcolor, bitwise_not, Gaussian_Blur and divide and converting the image.
- Imported original Image
- Grayscale image by using cvtcolor
- Inverted image by using bitwise
- Smoothen image by using Gaussian_Blur
- Final output skechted Image
-
Convert the color image to grayscale.
-
Invert the grayscale image to get a negative (invert image).
-
Apply a GaussianBlur() to the negative from previous step.
-
Finally, by using divide get the sketch image from the smoothen Image.