Skip to content
The source code of CVPR19 'Im2Pencil: Controllable Pencil Illustration from Photographs'.
Branch: master
Clone or download
Latest commit 70ca648 Mar 26, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
extract_edge_tone Add files via upload Mar 26, 2019
models Delete networks.cpython-37.pyc Mar 26, 2019
options Delete __init__.cpython-37.pyc Mar 26, 2019
output Add files via upload Mar 26, 2019
pretrained_models init commit Mar 25, 2019
LICENSE Initial commit Mar 20, 2019 Update Mar 26, 2019 init commit Mar 25, 2019


Pytorch implementation of our CVPR19 paper on controllable pencil illustration from photographs. More results and comparisons are shown here.

A line input (left) and two pencil outline results (middle: clean, right: rough)

A photo input (left) and four pencil shading results (right: [hatching, crosshatching; blending, stippling])

Getting started

git clone
cd Im2Pencil


  • Download the pretrained models:
sh pretrained_models/
  • Extract the outline and tone image from the input photo (in MATLAB):
cd extract_edge_tone


  • Test with different outline and shading styles:
python  --outline_style 1  --shading_style 1

Outline style: 0 for rough and 1 for clean

Shading style: 0, 1, 2, 3 for hatching, crosshatching, stippling, and blending respectively

For other controllable parameters, check options/


    author = {Li, Yijun and Fang, Chen and Hertzmann, Aaron and Shechtman, Eli and Yang, Ming-Hsuan},
    title = {Im2Pencil: Controllable Pencil Illustration from Photographs},
    booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
    year = {2019}


  • We express gratitudes to the great work XDoG and Pix2Pix as we benefit a lot from both their paper and code.
You can’t perform that action at this time.