← all repositories
jcjohnson/neural-style

The Lua Script That Taught Neural Networks to Paint

Implements the seminal 2015 paper that let convolutional networks remix photos into paintings.

neural-style
Not currently ranked — collecting fresh signals.
star history

What it does This is the reference Torch/Lua implementation of Gatys et al.’s “A Neural Algorithm of Artistic Style.” Feed it a photograph and a painting; it uses a pretrained VGG-19 network to synthesize a new image that keeps the photo’s structure while adopting the painting’s textures, colors, and brushwork. You can dial the content-style tradeoff, blend multiple artworks, preserve original colors, or adjust the -style_scale to control which visual features transfer.

The interesting bit Released in 2015, this repo became the proof-of-concept that launched a thousand art filters. It treats style as a statistical property of convolutional feature correlations—an idea that now feels obvious but was genuinely surprising at the time. At 18k stars, it is a time capsule from the era when generating an image meant running iterative optimization for 1000 iterations instead of a single forward pass.

Key highlights

  • Implements the exact algorithm from the original Gatys, Ecker, and Bethge paper
  • Supports multiple style images with weighted blending and interpolation
  • Adjustable -style_scale to control granularity of transferred artistic features
  • -original_colors flag preserves the content photo’s palette while transferring only texture
  • Backends for CPU, CUDA, cuDNN, and OpenCL (via the old Torch ecosystem)

Caveats

  • Built on Torch7 and Lua, a stack that has been largely abandoned in favor of PyTorch/Python
  • Memory-hungry: the default VGG-19 model needs a decent GPU; the README suggests falling back to a smaller NIN model for “smaller memory” cards
  • L-BFGS optimizer gives better results but uses more memory than ADAM

Verdict A must-read for ML archaeology students and anyone tracing the lineage of generative image models. If you need a modern, real-time style filter, this is a museum piece.

Frequently asked

What is jcjohnson/neural-style?
Implements the seminal 2015 paper that let convolutional networks remix photos into paintings.
Is neural-style open source?
Yes — jcjohnson/neural-style is open source, released under the MIT license.
What language is neural-style written in?
jcjohnson/neural-style is primarily written in Lua.
How popular is neural-style?
jcjohnson/neural-style has 18.3k stars on GitHub.
Where can I find neural-style?
jcjohnson/neural-style is on GitHub at https://github.com/jcjohnson/neural-style.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.