Skip to content

The "Image to Pencil Sketch" project aims to convert a digital image into a pencil sketch-like representation using Python and image processing techniques. The project leverages the capabilities of the OpenCV library, which provides various functions and tools for image manipulation.

Notifications You must be signed in to change notification settings

ashrafkhan10/LGMVIP--DataScience-Task-04-Image-to-Pencil-Sketch-with-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

LGMVIP--DataScience-Task-04-Image-to-Pencil-Sketch-with-Python

The "Image to Pencil Sketch" project aims to convert a digital image into a pencil sketch-like representation using Python and image processing techniques. The project leverages the capabilities of the OpenCV library, which provides various functions and tools for image manipulation. The process of converting an image to a pencil sketch involves several steps:

Grayscale Conversion: The first step is to convert the input image from its original color format (typically RGB) to grayscale. Grayscale images consist of a single channel, representing the intensity or brightness of each pixel. This simplifies the subsequent steps and allows us to focus on the image's overall structure.

Inversion: After converting the image to grayscale, it is inverted. Inverting an image involves subtracting each pixel value from the maximum value (e.g., 255 for an 8-bit grayscale image). This inversion creates a negative-like representation of the image.

Gaussian Blur: A Gaussian blur is applied to the inverted image. Gaussian blur is a type of image blurring that smooths out noise and reduces details. This step helps to simplify the image further and prepare it for the pencil sketch effect.

Inversion of the Blurred Image: The blurred image is inverted once again. This inversion enhances the edges and details in the image, making them more prominent.

Pencil Sketch Creation: The final step involves creating the pencil sketch effect by dividing the grayscale image by the inverted blurred image. This operation produces a sketch-like representation where the darker regions correspond to pencil strokes or lines.

By applying these steps, the project generates a pencil sketch effect that resembles a hand-drawn sketch created using a pencil on paper. The resulting image retains the overall structure and composition of the original image but appears as if it were drawn using pencil strokes.

The Python code provided earlier demonstrates how to implement these steps using the OpenCV library. It reads an input image, performs the necessary operations, and displays both the original image and the resulting pencil sketch.

The "Image to Pencil Sketch" project can be extended and customized further based on specific requirements. For example, additional image processing techniques can be incorporated to enhance the sketch effect or adjust the intensity of the pencil strokes. The project can also be integrated into applications or websites that involve image manipulation or artistic effects.

Overall, this project demonstrates the application of image processing and manipulation techniques to create a pencil sketch effect, providing an interesting way to transform digital images into artistic representations.

About

The "Image to Pencil Sketch" project aims to convert a digital image into a pencil sketch-like representation using Python and image processing techniques. The project leverages the capabilities of the OpenCV library, which provides various functions and tools for image manipulation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published