Deep Painterly Harmonization

Fujun Luan, Sylvain Paris, Eli Shechtman, Kavita Bala

Abstract

Deep Painterly Harmonization presents a novel two-pass neural algorithm for image compositing that integrates photographic objects into paintings. Unlike standard photo-blending or global style transfer, this method enforces spatial and inter-scale statistical consistency to ensure that the added element adopts the local brushwork, texture, and abstraction of the target painting. The approach significantly outperforms existing techniques by respecting the local context of the artistic medium.

Introduction

Image compositing—the process of "cutting and pasting" an object from one image into another—is a well-established technique for photographs. Tools like Poisson blending effectively hide seams and match lighting. However, these methods fail when the target background is a painting characterized by discrete brush strokes, canvas textures, and varying levels of abstraction. Standard blending often results in the object appearing as a misplaced "sticker" on the canvas. Conversely, global style transfer algorithms often apply a generic summary of the painting's style to the object, ignoring local stylistic nuances. The challenge lies in harmonization: making the new object appear as if it were originally painted by the artist in that specific location.

Methodology

The proposed pipeline utilizes the VGG-19 network architecture and consists of two primary optimization passes, an automated style estimator, and post-processing steps.

Two-Pass Optimization

  1. Pass 1: Robust Coarse Harmonization: This stage focuses on matching rough color and texture. It employs an "independent mapping" strategy where the algorithm identifies nearest-neighbor patches in the style image for every neural network layer. Gram matrices are then used to flexibly redistribute the style.
  2. Pass 2: High-Quality Refinement: To eliminate artifacts from the first pass, this step enforces inter-scale consistency. It ensures that if a patch in a deep layer matches a specific location in the painting, the corresponding patches in shallower layers match the same location. This prevents "texture mush" and maintains coherent brush strokes across scales.
Comparison of the harmonization process stages.

Automated Style Estimation and Post-processing

To avoid manual hyperparameter tuning, the authors trained a VGG-16 model on 80,000 paintings from the WikiArt dataset. This "Painting Estimator" categorizes style strength to automatically adjust weights for style and histogram matching. Finally, the pipeline concludes with chrominance denoising via a Guided Filter and a Patch Synthesis step (using PatchMatch) to ensure every pixel aligns with the source painting's texture.

Results and Discussion

The algorithm's effectiveness was validated through user studies and qualitative analysis of texture fidelity.

User Evaluation

In an "Edited or Not" study, the proposed method fooled observers significantly more often than state-of-the-art competitors like Deep Image Analogy or CNNMRF. In direct comparison tests, users preferred the results of this method in the vast majority of cases.

Texture and Robustness

The method successfully reproduces complex, non-uniform textures, such as the specific pattern of "craquelure" (fine cracks) found in historical masterpieces. Due to the automated Painting Estimator, the system is robust across a wide range of artistic styles, from photorealistic High Renaissance textures to abstract Expressionist strokes.

Final harmonized result.

Conclusion

Deep Painterly Harmonization addresses the unique challenges of artistic image compositing by prioritizing local statistics and inter-scale consistency. While the method is computationally intensive—taking approximately 5 minutes for a 500x500 image—it provides unparalleled quality in blending photographic elements into diverse artistic styles. Future work may explore feed-forward network approximations for real-time performance and extensions to video harmonization.

Summary updated

BibTeX
@article{luan2018deep,
  author = {Fujun Luan and Sylvain Paris and Eli Shechtman and Kavita Bala},
  title = {{Deep Painterly Harmonization}},
  journal = {Computer Graphics Forum},
  year = {2018},
  url = {https://openreview.net/forum?id=Eh3J7q_G0kl},
}
Figure