NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Preserving Color in Neural Artistic Style Transfer

Leon A. Gatys, Matthias Bethge, Aaron Hertzmann, Eli ShechtmanarXiv 2016

TL;DR

Original neural style transfer algorithms treat an artwork's texture and color as a package deal, often overriding the natural colors of a photograph. This paper introduces two simple linear techniques—color histogram matching and luminance-only transfer—to successfully decouple style from color, allowing you to re-imagine a photo in the style of a famous painting while perfectly preserving its original color palette.

What Problem Does This Paper Address?

The groundbreaking neural artistic style transfer (NST) algorithm by Gatys et al. allowed algorithms to fuse the semantic content of a photograph with the stylistic features (like brushstrokes or geometric shapes) of a painting. However, the original method suffered from a major usability flaw: it copied the color distribution of the style image completely.

If you tried to apply the style of Vincent van Gogh’s Starry Night to a photo of a sunlit garden, the garden would turn dark blue and yellow. While artistically interesting, this color overriding is often undesirable. The authors address this gap by asking: How can we transfer the texture, brushstrokes, and geometry of an artwork while keeping the original colors of the photograph intact?

Methods

The authors propose two distinct, lightweight approaches to solve this problem:

1. Color Histogram Matching (Color Transfer)

Instead of altering the style transfer algorithm itself, this method preprocesses the style image $S$ so that its color profile matches the content image $C$.

  • The algorithm applies a linear transformation ($x_{S'} \leftarrow Ax_S + b$) to the pixels of the style image to match the mean and covariance of the content image's RGB values.
  • The authors test two variants for the transformation matrix $A$: a standard Cholesky decomposition and an eigenvalue-based 3D color matching technique adapted from Image Analogies literature.
  • The newly color-matched style image is then passed into the standard NST pipeline.

2. Luminance-Only Transfer

This approach recognizes that human vision is far more sensitive to variations in brightness (luminance) than color.

  • The content and style images are converted from RGB to the YIQ color space, which isolates brightness ($Y$) from chromaticity ($I, Q$).
  • The standard neural style transfer optimization is run only on the luminance channels ($L_S$ and $L_C$) to generate a stylized luminance channel ($L_T$).
  • Finally, this stylized luminance channel is recombined with the original, unaltered color channels ($I, Q$) of the content photograph.
Example of color preservation methods compared to original style transfer.

Datasets

Not discussed in the paper. As this work presents an optimization-based algorithmic extension rather than a deep learning model requiring training, no large-scale datasets or training benchmarks were used. The methods are evaluated qualitatively using classic reference images, such as a farmhouse garden photograph, Van Gogh's Starry Night over the Rhone, and Picasso's Femme nue assise.

Key Insights and Ideas

  • Color matching before synthesis is crucial: The authors discovered that matching the style image's colors to the content image before running the style transfer yields significantly better results than trying to fix the colors after the style transfer is complete. Pre-matching reduces the optimization conflict within the neural network; the network no longer has to choose between reconstructing the content's layout and fighting the style's original color distribution.
  • The Color-Luminance Dependency Trade-off: While luminance-only transfer preserves the original colors perfectly, it completely breaks the link between brightness and color. In highly textured paintings with heavy brushstrokes, this creates an artifact where a single brushstroke might unnaturally contain multiple colors. Color histogram matching, on the other hand, preserves the integrity of the brushstrokes as cohesive "blotches of paint," even if the final color match isn't 100% exact.
Close-up comparison showing how luminance-only transfer can cause colors to misalign with brushstrokes.

Key Results

  • Algorithmic Preference: The Image Analogies (eigenvalue-based) color transfer method consistently outperformed the Cholesky decomposition. The Cholesky method suffers from a conceptual flaw where its output changes depending on the arbitrary ordering of color channels (e.g., RGB vs. BGR).
  • Computational Efficiency: Because the luminance-only method restricts the neural network optimization to a single channel instead of three RGB channels, it reduces the dimensionality of the optimization problem by one-third (33% fewer parameters to optimize).

Limitations and Future Work

  • Linear Color Limitations: The color histogram matching approach relies on simple linear mapping. If the color distributions of the two images are highly complex or mismatched, the linear transformation cannot achieve a perfect color match.
  • Stroke Artifacts: As noted in the insights, the luminance-only method can cause color bleeding across prominent brushstrokes, making the final output look less like a real painting upon close inspection.
  • Future Directions: The authors suggest that future work should focus on unifying these two statistical frameworks (color space statistics and CNN feature activations) and exploring more advanced, non-linear color mapping techniques.

Summary updated

BibTeX
@misc{gatys2016preserving,
  author = {Leon A. Gatys and Matthias Bethge and Aaron Hertzmann and Eli Shechtman},
  title = {{Preserving Color in Neural Artistic Style Transfer}},
  year = {2016},
  eprint = {1606.05897},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1606.05897},
}
Figure