• Stars
    star
    152
  • Rank 244,685 (Top 5 %)
  • Language
    MATLAB
  • Created almost 9 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

✏️ Pencil drawing production.

Introduction

Implement the algorithm presented in [1]. You can use the code like below to get a pencil drawing production:

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.

    alt text alt text

    Figure 1: Width of the strokes. left: width = 0; right: width = 2.

  • gammaS

    Control the darkness of the strokes. See Figure 2 for example.

    alt text alt text

    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.

    alt text alt text

    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. alt text

  2. alt text

  3. alt text

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.