Skip to content
Photo2Pattern

Free line art converter

Photo to line art with the threshold under your thumb

Free, nothing to sign up to: drop a photograph and it comes back as fine black lines on white at up to 1,400 px on the long side. One number decides the drawing — the edge threshold, which is the gradient a pixel has to reach before it becomes ink — and the table beside the result gives you the exact threshold for any ink density from 1% to 16%, read off a histogram of your own picture instead of guessed. Strokes shorter than the length you name are erased afterwards, which is how grain leaves and a jawline stays, and the picture is opened by this page rather than by a server.

  • 100% free
  • No signup
  • Threshold 0.2 to 30.0
  • Up to 1,400 px
  • Transparent PNG

Press Ctrl+V anywhere on the page to drop in the photograph you want drawn — no need to click the field first.

2.5

The gradient a pixel has to reach before it becomes ink, as a percentage of the strongest edge a picture can hold — black against white in both directions at once. Useful settings live between 1.0 and 8.0; the table under the drawing gives the exact number for the density you want instead of making you find it.

Three box passes each way, close enough to a Gaussian of the same radius. It runs before the gradient is measured, because a grain of noise and a hair produce the same number afterwards.

Thickening happens after the strokes are counted, so the stroke figures below describe the drawing rather than the pen.

Pixels in one 8-connected run. This is the only control here that is selective: raising the threshold or the blur weakens the contours you want at the same time as the speckle, while noise is short by nature and a jawline is not.

How to find the threshold this particular photograph wants

Only the threshold is a judgement call; the blur and the stroke cut have a right answer for a given file.

  1. Blur it slightly before anything looks for edges

    Sensor noise and skin texture produce the same kind of gradient a hair does, and no threshold can tell them apart once they are both numbers. One pixel of smoothing removes the noise of a well-lit photograph and costs nothing visible. Two removes pore texture and takes eyelashes with it. Three leaves only the large forms, which is what you want from a photograph shot at high ISO in a dark room and what you never want from a studio portrait. The smoothing runs first, before the gradient is measured, which is the only place it does any good.

  2. Take the threshold from the density table, not from the slider

    The right threshold is not transferable between photographs, because it is measured against the picture's own contrast. A backlit silhouette clears 20 everywhere and a foggy landscape never clears 3. So the table beside the drawing works backwards: you pick how much of the sheet should be ink and it hands you the threshold that produces it, exactly, from a histogram of every gradient in the file. Drawings that read as drawings almost always sit between 3% and 8%.

  3. Erase the short strokes last

    What is left after thresholding is a set of separate runs of ink, and the short ones are noise while the long ones are the subject — a jawline is one connected run of several hundred pixels and a speck of grain is four. Raising the minimum length erases the specks without touching the jaw, which is the one thing neither the blur nor the threshold can do, since both of them weaken every line at once. Twelve pixels is the default and 40 is usually enough to clean a hand-held photograph completely.

Technical specifications

How a pixel becomes inkA 3×3 Sobel gradient, thresholded. Magnitude is divided by 5.657 — the value the operator returns for a step from black to white in both axes at once — so the threshold reads as a percentage of the strongest edge that can physically exist rather than of anything about your file
The lightness the gradient runs onOklab L, the same perceptual axis this site matches colors on. Linear luminance would score an edge inside a shadow at a fraction of the visually equal edge in a highlight, which loses the dark half of every side-lit face
Threshold range0.2 to 30.0 in steps of 0.1, starting at 2.5. Above about 12 only specular edges and hard shadow lines survive; below 1.0 a photograph inks more than half the sheet
Density tableEight rows, from 1% to 16% ink, each giving the exact threshold that produces it. Computed from a 1,000-bin histogram of the picture's gradients built once when the file opens, so it is a lookup rather than eight re-runs and stays right while the slider moves
Smoothing0 to 4 px, applied before the operator as three box passes each way — within roughly 3% of a true Gaussian of the same radius. Default is 1 px, which clears sensor noise; 2 px is the point at which eyelashes stop being drawn
Short-stroke filter0 to 300 pixels, 12 by default, counted over 8-connected runs so that a clean diagonal stays a single stroke instead of becoming one stroke per pixel
OutputA PNG at up to 1,400 px on the long side — a smaller original keeps its own size and is never enlarged — black on white or with the paper left fully transparent. The canvas on screen is the file: nothing is re-rendered at a different size on the way out, so a 1 px line stays 1 px
What it refusesVector output, and any threshold that leaves zero strokes or inks more than 40% of the sheet. Both refusals come with the measured number that caused them and a button that sets a threshold which works

Frequently asked questions

Why is the whole picture solid black at a threshold of 1.0?

Because at 1.0 almost every pixel in a photograph qualifies. A gradient of 1.0 means the picture changes by about one hundredth of the full black-to-white range across two pixels, and a photograph of anything real does that nearly everywhere — the gradient of an out-of-focus wall is not zero, it is small. The number is a percentage of the strongest edge physically possible, not a percentage of the edges in your file, so the bottom of the scale is genuinely everything. Use the density table instead of the slider: it names the share of this particular picture that 1.0 would ink, which for most photographs is well over half.

My drawing is almost empty and the threshold is already at 3.0.

The photograph is soft, and the page tells you by how much: it measures the gradient reached by the strongest one percent of pixels, which typically lands between 12 and 25 in a sharp portrait and under 2 in a file that missed focus or was upscaled from a small original. No setting recovers an edge that was never recorded. Lowering the threshold below the noise floor inks the sensor grain instead of the subject, which is why the drawing goes from empty to speckled with nothing usable in between. A JPEG saved at low quality behaves the same way, because the compressor has already smoothed the fine detail out.

Why do the lines break up along a smooth cheek or a soft jaw?

Because the gradient dips below the threshold there, and that is the honest answer rather than a bug. Contrast along a curved surface falls where the surface turns away from the light, so a contour that is strong at the chin can be half as strong at the temple, and one threshold cannot be above the noise at the temple and below the contour at the chin at the same time. Open lines are normal in a drawing and an illustrator leaves them open on purpose. If you need every line to join up — because a child is going to color inside them — that is a different operation and it lives on the coloring page tool, which finds borders between areas rather than edges.

Can I get white lines on a dark background?

Turn on the transparent paper option and place the PNG over whatever background you like, in any editor. The file that comes out has ink where the strokes are and nothing at all everywhere else, so it composites straight over a photograph, a color wash or a mock-up without a blend mode. What the page will not do is hand you white-on-black baked in, because that is a decision about the thing underneath and the thing underneath is not here.

Why is the output capped at 1,400 pixels on the long side?

Because a threshold that means different things at different resolutions is not a number anybody can quote. Gradients are measured between neighboring pixels, so downscaling a photograph averages detail away and weakens every edge in it: the same file at 700 px and at 2,000 px genuinely has different edges, and a setting of 2.5 would produce a sparse drawing at one size and a dense one at the other. Fixing the working size is what lets the density table be exact and lets you write a setting down. A file that arrives smaller than 1,400 px is left at its own size rather than enlarged, since enlarging before an edge operator invents gradients that were never photographed. If you need the drawing bigger, enlarge the PNG afterwards.

Does the line weight setting change the stroke counts?

No, and that ordering is deliberate. Strokes are counted at the width the operator returned them, then the ink is thickened afterwards, so switching from 1 px to 5 px changes what the drawing looks like and leaves the number of strokes, the length of the longest one and the count of erased specks exactly where they were. If thickening happened first, two lines a pixel apart would fuse into one and the figures would drop for a reason that has nothing to do with the photograph.

Can it give me an SVG instead of pixels?

No — this page outputs a raster and stops there. Turning a thresholded bitmap back into curves is a separate operation called tracing, it loses and invents detail in its own particular ways, and it needs its own controls for corner tolerance and path simplification. A page that quietly ran a tracer after the threshold would hand you paths whose shape was decided by settings you never saw. If you want a vector, take the PNG to a tracer and choose those settings yourself.

About edge thresholds, and why nobody can tell you the right number

An edge detector does not find outlines. It measures a rate of change: at every pixel it asks how quickly the picture is getting lighter or darker, in both directions at once, and returns one number for that speed. A Sobel operator does it with a 3×3 window that weights the pixel directly above twice as heavily as the two diagonally above, which is what makes it tolerant of a single bad pixel where a plain difference is not. Everything you see on this page is that one number thresholded. It follows that the operator has no idea what a face is, no idea that the line along a chin is important and the line along a fold in a curtain is not, and no way of joining two ink pixels that happen to lie next to each other into a stroke that means something. All of that is your job, and the controls here exist to make it doable rather than to pretend it has been done.

The consequence people run into first is that a threshold does not travel. It is measured against the strongest edge that can physically exist — black touching white — rather than against the contrast your photograph happens to have, so a value that draws a clean portrait of somebody in hard afternoon light will produce almost nothing from the same person photographed against a white studio wall. That is why the density table works in the opposite direction from every other tool of this kind: you say how much of the sheet should be ink, and the histogram of this file supplies the setting. Between 3% and 8% is where a photograph reads as a drawing; under 2% you are looking at the four or five strongest contours only, and over 15% the texture of the subject starts arriving alongside its shape. The other thing worth knowing is that the three noise controls are not interchangeable. Blurring and raising the threshold both weaken every line in the picture, the ones you want included; erasing short strokes is selective, because noise is short by nature and a contour is not. Reach for it first.

The nearest page to this one is turning a photo into a coloring page, and it is worth knowing which of the two you actually want, because they look similar and are built on opposite ideas. This page draws where the picture changes fastest, so its lines stop wherever the contrast dips and it is perfectly happy to leave a contour open — which is what a drawing does. That one draws the border between areas of flat tone, so every line is a closed loop and a crayon has somewhere to stop. Elsewhere on the site, the ASCII art generator is the same thresholding idea applied to a grid of characters instead of pixels, and pixelating an image is the exact inverse operation: it throws detail away deliberately rather than isolating it. If what you want is not a drawing at all but a reference to copy by hand, square by square, the grid drawing tool puts a numbered lattice over the photograph and leaves the photograph alone.

Where the edges are measured

Your picture is opened by JavaScript running in the tab you are reading this in. It is never uploaded, never sent to a server and never stored anywhere — there is no upload step to undo, because there is no upload. Close the tab and nothing of it remains.

The gradient histogram, the stroke list and the PNG are all built from a single decode that exists only while the tab does. The file is never read a second time, there is no render queue and no job to expire — closing the tab is the whole of the deletion.