Introduction
Artistic Style Transfer has seen significant advancements with deep learning, yet pencil illustration remains uniquely challenging. Traditional methods often struggle to replicate the distinct, directional strokes characteristic of real pencil work, frequently resulting in "muddy" or blurred outputs. Im2Pencil addresses these limitations by introducing a controllable framework that decouples the drawing process into separate outline and shading tasks. This approach allows for fine-grained control over artistic styles, such as hatching, stippling, or varying outline "sketchiness," producing results that are both realistic and highly customizable.
Methodology: A Two-Branch Architecture
The core innovation of Im2Pencil is its dual-branch model, which treats outlines and shading as distinct sub-tasks to better capture their unique mathematical signatures.
The Outline Branch
The outline branch focuses on the structural boundaries and "sketchiness" of the drawing. To overcome the lack of paired training data (photos and their corresponding professional sketches), the authors utilized Extended Difference-of-Gaussians (XDoG) filters on existing pencil drawings to create simplified abstractions. The model learns to map these abstractions to either "rough" or "clean" pencil outlines.
The Shading Branch
Shading in pencil art is defined by texture and stroke orientation rather than simple gray levels. To avoid artifacts common in direct photo-to-shading translation, the authors implemented a two-stream input for this branch:
- Edge Map: Provides structural guidance for stroke orientation.
- Tone Map: Extracted via a Guided Filter to provide target intensity.
The model is trained to generate four distinct shading styles: hatching, crosshatching, blending, and stippling.
Training and Style Control
Both branches utilize a "selection unit"—a one-hot vector—that allows users to toggle between desired styles. The training process employs a combination of Perceptual Loss for sharpness and a Multi-scale Adversarial Loss. The latter uses three PatchGAN discriminators at different resolutions (64x64, 128x128, and 256x256) to ensure the model captures both fine-grained stroke textures and global tonal structures.
Evaluation and Results
Due to the absence of standard benchmarks, the researchers curated a custom dataset of outlines and shading styles, augmented to thousands of training pairs. In a blind user study with 50 subjects, Im2Pencil was preferred 78.3% of the time over CycleGAN (10.3%) and traditional Non-Photorealistic Rendering (NPR) methods (11.4%). Qualitatively, the model generates strokes that respect the underlying geometry of the subject, such as hatching lines following the contours of a face. The model also successfully extends to colored pencil drawings by processing the luminance channel in LAB color space.
Conclusion and Future Work
Im2Pencil demonstrates that a "divide and conquer" strategy is highly effective for complex artistic tasks. By separating outlines from shading and using pseudo-ground truth data, the model achieves superior realism and control. While the current model relies on local features, future work could incorporate semantic understanding to better align stroke patterns with 3D forms, or offer even more granular control over parameters like stroke thickness and pressure.
Summary updated