# PencilDrawing
**Repository Path**: lea-chen/PencilDrawing
## Basic Information
- **Project Name**: PencilDrawing
- **Description**: :pencil2: Pencil drawing production.
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-07-01
- **Last Updated**: 2021-11-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Introduction
Implement the algorithm presented in [1]. You can use the code like below to get a pencil drawing production:
```C++
I = PencilDrawing(im, ks, width, dirNum, gammaS, gammaI);
```
See demo.m for example.
# Parameters
I added some more parameters for better control of the final image.
* **width**
Control the width of the strokes. See Figure 1 for example.
 
**Figure 1**: Width of the strokes. left: width = 0; right: width = 2.
* **gammaS**
Control the darkness of the strokes. See Figure 2 for example.
 
**Figure 2**: Gamma of the strokes. left: gammaS = 1.0; right: gammaS = 2.0.
* **gammaI**
Control the darkness of the final image. See Figure 3 for example.
 
**Figure 3**: Gamma of the final image. left: gammaI = 1.0; right: gammaI = 0.4.
## Tone Transfer Weights
The paper presented three groups of weights for tone map generation.
1. 
2. 
3. 
These weights will determine the histogram of the tone map. I use the third group by default, which makes the final image lighter. You can change to other groups in GenToneMap.m.
# Folder Organization
* **inputs**
Include some test images from the website of the publishers and other images.
* **pencils**
Include 5 pencil textures for demonstration. I use “pencils/pencil0.jpg” by default. You can change it in PencilDrawing.m.
* **results**
Include the results generated by my code. Each image may use different parameters.
* **resultsFromPaper**
Include the results of the paper for comparison. I grabbed them in their website.
# Reference
[1] Lu C, Xu L, Jia J. Combining sketch and tone for pencil drawing production[C]//Proceedings of the Symposium on Non-Photorealistic Animation and Rendering. Eurographics Association, 2012: 65-73.