Design and Social Media

Neural Style Transfer Explained: Repaint Photos Like Famous Artworks

How neural style transfer separates content from style, why fast style networks run in real time, and how to set detail size and strength for good results.

Saizul Amin
Saizul Amin28 Oct 2026 · 3 min read
Neural Style Transfer Explained: Repaint Photos Like Famous Artworks

Neural Style Transfer Explained: Repaint Photos Like Famous Artworks

In 2015, researchers showed that a neural network trained to recognise objects can also separate what a picture shows from how it is painted. That observation launched neural style transfer: repainting a photo with the brushwork and colours of an artwork. The AI Style Transfer tool runs four fast style networks in your browser.

Content and style

A recognition network processes an image in layers. Early layers respond to colours, edges and textures; deeper layers respond to shapes and objects. Gatys, Ecker and Bethge found that the deep layers capture the content of a picture, while the correlations between features in many layers capture its style: the textures, colour combinations and stroke patterns. Style transfer creates a new image whose deep features match your photo and whose feature correlations match the artwork.

From minutes to milliseconds

The original method optimised each new picture step by step and took minutes on a graphics card. In 2016, Johnson, Alahi and Fei-Fei trained a separate "transformation network" for each style. Once trained, it repaints any photo in a single forward pass, which is fast enough for a browser. The tool uses four such networks published in the ONNX Model Zoo: mosaic, candy, rain princess and udnie.

Why the picture is painted in tiles

These networks were exported for 224 x 224 pixel inputs. To handle bigger photos, the tool splits the photo into overlapping tiles of that size, paints each tile and blends the overlaps with soft weights. The detail size setting controls how many tiles are used:

  • Small detail size: the photo is reduced first, so each tile covers a large area and the strokes look big and bold.
  • Large detail size: more tiles, finer strokes, longer processing.

Medium is a good starting point; choose fine or very fine for large prints.

Strength and colour preservation

Style networks can overpower a photo, especially faces. Strength blends the painted version with the original. The keep-colours option takes the brightness pattern of the stylised image and the colours of your photo, a technique known as colour-preserving style transfer. It gives a painterly texture while keeping natural skin and sky colours.

Choosing photos

Landscapes, cities, pets, flowers and food photos work well. Photos with strong composition and clear shapes keep their meaning even after heavy styling. For portraits, use lower strength, keep colours and a medium detail size.

Ideas

  • Posters and canvas prints from travel photos.
  • Album and playlist covers.
  • A consistent art series for a website or menu.
  • Greeting cards and invitations.

Respecting artists

The styles imitate the look of famous works but are generated by networks. Do not present your results as original paintings by those artists, and avoid using them to pass off imitation as someone else's work.

Privacy

Each style network, about 6.7 MB, is downloaded when you first choose it and runs on your device. No photo leaves your computer.

A quick workflow

  1. Load a photo with a clear subject.
  2. Allow the style model to download.
  3. Try each of the four styles at medium detail.
  4. Lower the strength until faces and text stay readable.
  5. Tick keep colours for a subtler, photographic look.
  6. Export at full size.

Quick answers

Does a bigger detail size always look better? No. Fine strokes suit large prints; bold strokes often look more like a painting on screen.

Can I use the result commercially? The model licence (BSD) allows it, but make sure you own the photo you started from.

Limits

Only four styles are included, because training new styles requires a GPU and a dataset. Very large flat areas may show slight texture variations between tiles.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages