Photo to Line Art
Turning a photo into line art means throwing away the color and the shading and keeping only the edges. The tool that does it has three sliders, and one of them does almost all the work. That slider is not a "more detail" dial — it is a cutoff number, and knowing what number it is cutting makes the difference between a clean page and a black one.
The short answer. Open the ColoringZap converter, drop your photo in, and start here:
Clean, well-lit photo (the normal case): Smoothness 0, Edge Detail 40, Line Width 2.
Grainy, dim, or phone-at-night photo: Smoothness 2 first, then Edge Detail 60, Line Width 1. Do not skip the Smoothness step — on a grainy photo it is the only control that works.
Why: Edge Detail is a threshold on how strong an edge has to be before it gets drawn, measured in brightness steps out of 255. The slider runs from 10 to 80. A hard black-to-white boundary scores 1020. So the entire slider lives in the bottom 8% of the range — fine for tuning a clean photo, and nowhere near enough to fight real grain. That is what Smoothness is for.
What Edge Detail actually measures
Before any line is drawn, the tool runs a Sobel edge detector over the grayscale version of your photo. For every pixel it asks: how fast is brightness changing here? The answer comes back as a single number, and Edge Detail is the cut-off — any pixel scoring higher gets inked, everything below stays white. The label reads like a detail dial, but it works the other way round: a bigger number means fewer lines.
The number is not abstract. It is built from brightness steps on a 0–255 scale, and the arithmetic gives it a hard ceiling:
| What is in the photo | Sobel score | Where that sits on the slider |
|---|---|---|
| Mathematical maximum (both kernels fully saturated) | 1442 | — |
| A hard black-to-white step — the strongest edge a photo can hold | 1020 | 12.7× the slider's top value |
| Slider maximum (Edge Detail 80) | 80 | 7.8% of a hard edge |
| Slider minimum (Edge Detail 10) | 10 | 1.0% of a hard edge |
| A gentle ramp of 4 brightness levels per pixel | 32 | Clears most of the slider |
Scores above are computed from the same 3×3 Sobel kernels the tool uses. The 1020 figure is the measured score of a synthetic black-to-white step; the 32 figure is a synthetic linear ramp.
Read that table once more, because it explains almost every bad result: at the very top of the slider, the tool still calls anything with 7.8% of a hard edge's contrast a line. Camera grain, JPEG mush, and sensor noise in a dim photo all clear that bar easily. There is no slider position that rejects them, so you have to remove them before the threshold is applied — which is exactly what Smoothness does.
What a real photo actually scores
We ran the edge detector over an 800×600 test photo and recorded the score of every one of the 480,000 pixels. The distribution is not a bell curve — it is almost entirely empty, with a thin spike of genuine edges at the top:
| Percentile | Sobel score | What that means |
|---|---|---|
| Median (50th) | 0 | Half the photo has no brightness change at all |
| 90th | 4 | Nine pixels in ten are flat |
| 99th | 307 | The real outlines start here |
| 99.9th | 643 | Strongest outlines |
| Maximum | 846 | The hardest edge in the photo |
That gap — 90% of pixels below 4, the top 1% above 300 — is what makes the tool work at all. There is daylight between "nothing" and "an edge", and the threshold can be dropped into it. Now look at how much of the photo gets inked at each slider position on this same clean photo:
| Edge Detail | Share of the page inked | Edge Detail | Share of the page inked |
|---|---|---|---|
| 10 | 4.80% | 50 | 3.06% |
| 20 | 3.55% | 60 | 2.97% |
| 30 | 3.25% | 70 | 2.85% |
| 40 | 3.16% | 80 | 2.72% |
This is the part people do not expect: on a clean photo, the whole slider barely matters. Dragging it from one end to the other moves ink coverage from 4.80% down to 2.72% — a 43% relative change, and every position lands in the printable band. If your photo is clean, you cannot ruin it with Edge Detail, and you cannot rescue a bad photo with it either. It is a fine-tuning control, not the main one.
Why grainy photos come out black
We added synthetic sensor grain to the same photo at two levels and re-measured the distribution. This is where the picture changes completely:
| Photo | Median score | 90th percentile | Mean score |
|---|---|---|---|
| Clean original | 0 | 4 | 9.4 |
| Mild grain (σ = 6) | 16.7 | 32.2 | 24.8 |
| Heavy grain (σ = 12) | 32.8 | 63.1 | 41.1 |
On the clean photo the median is 0. On the heavily grained one it is 32.8 — which sits inside the slider's own 10-to-80 range. Half the pixels in the photo now score higher than a real edge needs to. No threshold you can set will separate them, because the noise and the subject are scoring in the same band.
Here is what that does to the page. These are measured ink percentages on the σ = 12 photo, before any line thickening:
| Smoothness | Edge Detail 10 | 20 | 40 | 60 | 80 |
|---|---|---|---|---|---|
| 0 | 93.0% | 76.7% | 36.4% | 12.0% | 4.2% |
| 1 | 69.1% | 25.6% | 4.4% | 3.6% | 3.1% |
| 2 | 24.9% | 6.2% | 4.7% | 3.6% | 2.9% |
| 3 | 9.0% | 6.7% | 4.7% | 3.5% | 2.3% |
| 4 | 9.1% | 7.1% | 4.7% | 3.0% | 1.7% |
At Smoothness 0 and Edge Detail 10, 93% of the page is black — a solid rectangle. Pushing Edge Detail to the maximum gets it to 4.2%, still dense. But one step of Smoothness at Edge Detail 40 takes it from 36.4% to 4.4%, an 88% reduction, and lands squarely in the printable band. Smoothness is the control that fixes grain. Edge Detail is not.
The best result in the whole grid is Smoothness 4 with Edge Detail 80 at 1.7% — cleaner than the clean photo's own 2.72%, because the blur flattened the residual texture as well as the grain. If you overshoot and the page looks too empty, back Smoothness to 2 and drop Edge Detail to 40.
The counterintuitive part: Smoothness adds ink to a clean photo
Run the same sweep on the clean photo and Smoothness moves in the opposite direction. At Edge Detail 40:
| Smoothness | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| Ink coverage, clean photo | 3.16% | 4.11% | 4.75% | 4.72% | 4.80% |
| Ink coverage, grained photo (σ = 12) | 36.4% | 4.4% | 4.7% | 4.7% | 4.7% |
Same slider, same threshold, opposite effect — +52% ink on the clean photo, −88% on the grained one. The reason is mechanical: blurring spreads a hard edge across several pixels instead of one. Every one of those spread pixels still clears a low threshold, so the line gets physically wider before anything is discarded. On a photo full of noise there is plenty to discard, and the discarding wins. On a clean photo there is nothing to discard, so you only see the widening.
That gives a rule you can act on immediately: if your photo looks clean, leave Smoothness at 0. Raising it will not tidy anything up — it will just fatten every outline and start merging the small shapes together. Only reach for it when you can see grain.
On a clean photo, Smoothness only starts removing ink at the very top of the Edge Detail range: at Edge Detail 80, Smoothness 3 measures 2.34% and Smoothness 4 measures 1.68%, both below the 2.72% you get at Smoothness 0. Everywhere else on the slider it adds.
Line Width is the only linear control
Line Width thickens whatever survived, and unlike the other two it behaves exactly as you would expect. Measured on the clean photo at Smoothness 0, Edge Detail 40:
| Line Width | Ink coverage | Separate shapes on the page | Verdict |
|---|---|---|---|
| 1 | 3.16% | 18 | Thin — good for pencils, faint under marker |
| 2 | 5.46% | 10 | The default worth using |
| 3 | 7.45% | 10 | Heavy — crayons and thick tips |
| 4 | 9.42% | 10 | Approaching the point where the page stops being colorable |
Each step adds almost exactly 2.0 percentage points of ink — the most predictable thing in the whole pipeline. Notice the shape count dropping from 18 to 10 at Line Width 2: thickening closes small gaps and fuses neighbouring shapes, which is usually what you want, but it is also how small details disappear. If a page loses a feature you cared about, drop back to Line Width 1 rather than lowering Edge Detail.
A practical frame: below about 1.5% ink the page is nearly blank, and above roughly 12% it turns into a grey mass with no white left to color. Every number in this article is measured as that ink percentage, so you can place any setting on that scale.
Small images come out much denser
The same photo, the same Edge Detail 40, three working sizes:
| Working size | Ink coverage |
|---|---|
| 800 × 600 | 3.16% |
| 400 × 300 | 5.39% |
| 200 × 150 | 8.69% |
Shrinking the photo makes the page nearly three times denser at identical settings, because each outline takes up a bigger share of fewer pixels. So if you are converting a small image — an old file, a cropped screenshot, a thumbnail — start one notch higher on Edge Detail and one lower on Line Width than you otherwise would. Big photos are the easy case; the converter caps its working size at 1400 pixels on the long side, and anything above that is scaled down before processing.
What the cleanup step really removes
After the lines are thickened, the tool runs one despeck pass. It is narrower than people assume: it deletes a black pixel only when none of its eight neighbours is black, which means it removes lone single pixels and nothing else. Pairs, triples and small clusters all survive.
Measured on the clean photo at Smoothness 0, Edge Detail 20: the raw result held 156 separate shapes, of which 82 were single pixels — 53% of everything on the page. The cleanup deleted all 82. That sounds like a lot, but they were only 0.03% of the page's area, and 54 of the 74 shapes that remained were still five pixels or smaller. Visible flecks on a finished page come from those survivors, not from the ones that got deleted — and since the pass cannot touch them, the fix is to raise Edge Detail or Smoothness upstream, not to hope the cleanup catches them.
At Edge Detail 40 the same photo produced just 4 single pixels and one shape under five pixels. The jump from 20 to 40 on the slider is worth more cleanup than the cleanup step itself.
Where the time goes
Median of 7 runs on the 800×600 photo at Smoothness 1, Edge Detail 40, Line Width 2, on one Node 22 process:
| Stage | Time (ms) | Share |
|---|---|---|
| Grayscale conversion | 1.9 | 3.5% |
| Gaussian blur | 15.4 | 28.0% |
| Sobel edge detection | 17.2 | 31.3% |
| Line thickening | 17.0 | 30.9% |
| Despeck | 2.7 | 4.9% |
| Total | 55.0 | 100% |
Two things worth knowing. Blur costs about as much as the edge detection that follows it, so Smoothness is not free — it is the difference between a 40 ms and a 55 ms pass. And the whole thing runs in your own browser tab, so this is wall-clock time on your machine, not a queue behind someone else's job. There is no upload, which is also why there is no account and no wait.
A working recipe, in order
- Look at the photo. Can you see grain, or was it shot in dim light? If yes, start at Smoothness 2. If no, Smoothness 0 and leave it there.
- Set Edge Detail 40. On a clean photo this is close to optimal and the slider barely matters, so there is little to gain from hunting.
- Set Line Width 2 for printing, 1 if the drawing has a lot of fine detail you want to keep, 3 for crayons.
- Look at the result and change one thing. Too black → raise Smoothness first if the photo was grainy, otherwise raise Edge Detail. Too empty → lower Edge Detail, or drop Smoothness back to 0. Outlines too faint to color inside → raise Line Width, nothing else.
- Still bad? Change the photo, not the settings. A subject against a plain background, shot in daylight, beats any amount of slider work. Photos made mostly of smooth gradients — sky, soft skin, blurred backgrounds — have no hard edges for the detector to find, and no setting will produce them.
What to do with the line art
Print it as-is, or take it further. If you would rather have numbered color blocks than open outlines, the same photo goes through Picture to Color by Number, which quantizes it into a small palette and numbers each region. A stack of photos becomes one PDF with Coloring Book Maker, one drawing per page. For a page that is not a photo at all, Name Coloring Page Generator draws any name in big outlined letters.
The step-by-step walkthrough for photo conversion is on Convert a Picture Into a Drawing, and if you want the settings broken down by photo subject — bold shapes, foliage, fur, soft portraits — see Turn Photo Into Line Drawing. This page is about the number underneath the slider; that one is about what to do with it per photo type.
Questions
Does my photo leave my device? No. Grayscale, blur, edge detection, thickening and cleanup all run in your browser tab. Nothing is uploaded, so there is no server copy of your picture and no account to sign up for — see the Privacy Policy.
Is line art the same as a line drawing? In this tool, yes — the output is black outlines on white either way. The words get used interchangeably; the pipeline behind them is the one described above.
Why do my numbers differ from the tables? Every figure here was measured on one 800×600 photo and on synthetic grain added to it. Your photo has its own contrast, resolution and noise, so the exact percentages will shift. The structure holds: the median score of a clean photo sits near zero, the median score of a grainy one lands inside the slider's range, and Smoothness is the control that moves it.
Can I reproduce these measurements? Yes. The pipeline is open source on GitHub (coloringzap-algorithms) along with the scripts that produced every table on this page, and the parameter-sweep dataset is archived on Zenodo (doi.org/10.5281/zenodo.22812174).
Is there a limit? No daily limit and no watermark. Convert as many photos as you want.