Oil · watercolour · pencil · ink · pointillism · posterise

Photo to Painting Filter

Turn a photo into a painting or drawing with fixed image-processing rules, tune each style with sliders, and export at up to 16 million pixels.

Photo

PNG, JPG, WEBP, GIF or BMP

Drop a photo here or click to choose

Up to 25.00 MB. Pictures over 4,600 px on the long side are scaled down when opened.

Style

Averages colour inside the calmest of eight sectors around each pixel, with the sectors stretched along local edges, so strokes follow contours and edges stay sharp.

0 gives round sectors; 1 stretches them along edges.

Higher picks the calmest sector more strictly.

Export

Preview

Open a photo to see it painted.

Photo to Painting Filter

Operator: Abdulla Al Fahad. How tools are built and checked

A painting filter has one job: throw away detail the way a brush does, in some places and not others. A blur removes detail everywhere and leaves mud; a good filter keeps the edge of a face or a roof sharp while flattening the sky and the skin around it.

The six styles here are classical image-processing methods, written out in the page's own code, so the same photo and sliders always give the same picture and nothing is generated or guessed by a model.

Each style has a strength slider and three more that change how it looks, and the preview is a before and after slider you can drag.

Key features

  • Oil painting: a generalised Kuwahara filter with eight sectors, stretched into ellipses along local edges
  • Watercolour: edge-preserving smoothing, soft colour steps, paper grain, pooled dark edges and a wash toward warm paper
  • Pencil sketch: colour dodge of the grey picture against a blurred negative, with graphite or colour-pencil output
  • Ink drawing: difference-of-Gaussians outlines with optional cross hatching in the dark areas
  • Pointillism: round dots of the local average colour on a jittered grid, drawn in random order on a pale canvas
  • Posterise: smoothing, per-channel level reduction, saturation control and optional outlines

How each style is made

The oil filter measures the local edge direction with a smoothed structure tensor, which gives each pixel an orientation and a strength. Around each pixel it builds an ellipse whose long axis follows the edge, whose long and short half-axes are the brush radius times (1 + k) and divided by (1 + k), where k is Follow edges scaled by how one-directional the local edge is, so at full strength on a straight edge it is four times as long as it is wide, splits it into eight sectors, and averages the colour inside each with a Gaussian weight. It then blends the sector averages, giving most weight to the sectors with the least variation, so the result takes the colour of the calmest side of an edge. With Follow edges at 0 the ellipses are circles and the strokes lose their direction.

Brush, dot and line sizes grow with the picture's short side: the oil brush radius is 1 px plus 0.65 percent of the short side times the strength slider. A 1,000 px preview and a 2,000 px export of the same photo therefore look alike, with the export showing finer detail, though not identical, because of the fixed 1 px. Window sampling is thinned for large brushes so the cost per pixel stays bounded, and the page refuses an export over 16 million pixels or one whose estimated work is far beyond a few minutes.

How it works

The photo is drawn at up to 1,000 px for the preview and processed in a worker; moving a slider cancels the running job and starts a new one after a short pause. Export repeats the same filter on a copy at the size you choose, with a progress bar and a Cancel button that stops the worker at once.

The paper grain, dot placement and random draw order use fixed seeds, so rendering twice gives the same pixels.

Common use cases

  • A portrait for a card is painted in oil at 40% brush and 80% Follow edges: strokes run along the jaw and collar instead of across them, and the 2,000 px PNG prints sharply at 6.7 × 5 inches at 300 dpi.
  • A landscape photo becomes a watercolour with grain at 70% and edge darkening at 30%: skies flatten into washes while the horizon line keeps a darker pooled edge.

How to use this tool

  1. Open a photo. Pictures larger than 4,600 px on the long side are scaled down at this step.
  2. Pick a style and drag its sliders while watching the before and after preview.
  3. Choose an export size and format.
  4. Press Render and download. Large oil and watercolour exports show progress and can be cancelled.

Example

A 4,000 × 3,000 photo, oil painting style at the default 50% brush

Preview at 1,000 × 750 px, then export at 2,000 × 1,500 px

Brush radius at each size

Preview brush radius 3.44 px, which is 0.46% of the 750 px short side
Export brush radius 5.88 px, which is 0.39% of the 1,500 px short side
A 4,600 × 3,450 export (about 16 million pixels) is the largest the page accepts

Edge cases to watch

Brushes that follow edges need edges. A smooth gradient or a heavily blurred background shows the isotropic look.

Alpha is carried through unchanged, so a transparent PNG keeps its cut-out while the colours inside it are repainted.

  • Pointillism rewards a larger source: the dot grid is set from the short side, so a 3,000 px export has many more dots than the preview shows. Use the 1,200 px export to check the dot density first.
  • For ink, lower the outline threshold until the faces have eyes, then raise hatching only for dark clothing and shadows.

Common errors and how to fix them

"That would place … dots, over the 3,000,000 limit. Raise the dot size."
Pointillism places one dot per grid cell. Increase the dot size slider or reduce the overlap, which widens the grid spacing.
"The painting worker stopped, probably from running out of memory"
Choose a smaller export size. A 16-million-pixel export holds several full-size copies of the picture at once.

How watercolour is made

Watercolour runs two to five rounds of a small bilateral filter depending on the picture's size, which smooths colour but stops at strong edges, then mixes each channel halfway toward a coarse set of steps so washes look flat. Grain comes from layered value noise that darkens dark pigment more than light, and edges are found with a Sobel filter on a blurred grey copy and darkened by up to 55 percent.

Pencil, ink and posterise

Pencil inverts the grey picture, blurs it with three box passes, and divides the grey by one minus the blur, the colour-dodge blend that leaves light outlines and soft shading. Ink subtracts two blurs, the second 1.6 times wider than the first, and hatches in two crossing directions wherever a blurred tone falls below a threshold. Posterise rounds each channel to between 2 and 12 levels after optional smoothing.

Frequently asked questions

What does Follow edges change in the oil style?

At 0 every brush is a circle, so the strokes have no direction. As the slider rises, the brush stretches along strong, one-directional edges such as a jaw line or a roof, up to four times as long as wide at 100 percent, and stays round in flat areas where no edge direction exists.

Why is the export not a pixel-for-pixel copy of the preview at a bigger size?

Strokes, dots and grain are defined as fractions of the picture, but the export has more pixels to place them on, so edges inside a stroke are finer. The overall look is the same; the detail is not magnified preview detail.