Skip to content

LarsPh/Pencil-Sketch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pencil-Sketch

Produce pencil drawing from natural images.

About the algorithm

  • The algorithm is mainly based on "Combining Sketch and Tone for Pencil Drawing Production" Cewu Lu, Li Xu, Jiaya Jia, International Symposium on Non-Photorealistic Animation and Rendering (NPAR 2012), June, 2012 (http://www.cse.cuhk.edu.hk/~leojia/projects/pencilsketch/pencil_drawing.htm)

  • In the edge detection step, instead of the gradient method provided in the paper, bilateral filter and Laplacian edge detection are used to generate a less noisy image, which significantly impact the quality of final result in this implementation.

Other references

Getting Started

Prerequisites

  • Modules required: numpy, scipy, Pillow, opencv-python, matplotlib.
  • Textures of pencil sketch are provide in directory "textures" if required.

Running the program

Call function pencilSketch() to run the program, you can also specify the parameters to change the looking of out image. For details of parameters please check the comment in source code and the references.

Result images

The default directory program looks for input and texture images are "soure_images" and "textures", you can modify the folders' name by specifying them when calling the function. The output colored and grayscale pencil sketch images are saved in folder output. The intermediate images are saved in folder temp.

Gallery

test1 test1_output test1_colored_output test2 test2_output test2_colored_output test3 test3_output test3_colored_output

About

Produce pencil drawing from natural images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages