A coloring page is line art: black outlines, white space in between, nothing else. Getting there from a photograph is a question of deciding which of the photo’s edges are real enough to draw, and this page hands you that decision as two numbers rather than a mystery preset.
Sobel gradients, and what the threshold number is measured in
Every photo you drop in is converted to a single gray channel, optionally blurred, and then run through the two classic 3x3 Sobel kernels, which measure how fast brightness is changing horizontally and vertically at each pixel. The two components are combined into one gradient magnitude, and any pixel whose magnitude reaches the Line threshold is painted pure black. Everything else is painted pure white.
The kernels are normalized by 4 on purpose, and it makes the slider mean something concrete. On a clean edge between two flat regions, the resulting magnitude comes out equal to the difference in their gray values: a step from 100 to 140 reports exactly 40. So the default threshold of 40 reads as “draw a line wherever brightness changes by at least 40 of 255 levels”, and the two pixel columns either side of a hard boundary both cross it, which is why a sharp edge comes back as a line roughly two pixels wide.
Detail blurs first, which can erase a weak edge completely
Detail is a Gaussian pre-smoothing radius, from 0 to 10, applied to the gray channel before any gradient is measured. At 0 the blur pass is skipped entirely and every speck of sensor noise and fabric texture gets a fair shot at becoming a line. At the default of 2 the kernel is five pixels wide, which is enough to settle down a typical phone photo.
The trade-off is sharper than it sounds. Blurring spreads a brightness step over several pixels, so the peak gradient at each one drops. In a hand-run test on a synthetic 40-level step, a Detail of 2 flattened it far enough that the default threshold caught nothing at all. On a contrasty subject that never happens; on a hazy or backlit one it happens easily. If a page comes back nearly blank, take Detail down before you touch anything else.
From a photo to a page you can print
- Drop JPG, PNG or WebP photos onto the box, or press Choose files. Several at once is fine, and duplicates of the same name and size are ignored.
- Set Detail for how much texture to smooth away first, and Line threshold for how strong an edge has to be before it becomes a line.
- Pick an Output format:
Printable PDF (A4),Printable PDF (US Letter), orPNG image (original resolution). - Press Turn a Photo into a Coloring Page. The tracing runs on your own device, so the photo is never uploaded anywhere.
- Download each result. The suffix
-coloring-pageis appended to the original name, so abirthday.jpgcomes back asbirthday-coloring-page.pdf.
Two colors of equal brightness leave no line at all
This is the limitation worth internalizing before you blame the sliders. The
gray conversion uses the standard broadcast weighting, roughly three tenths red,
six tenths green, one tenth blue. Pure red maps to 76 on the gray scale. The CSS
color green, which is rgb(0, 128, 0), maps to 75. Put one directly against the
other and the gradient between them is about one level, nowhere near any usable
threshold, so no line is drawn even though the boundary is glaring to your eye.
Nothing on this page can recover an edge that does not exist in brightness. If that is the shape you need traced, push the two areas apart in tone first with the image adjustment tool, or accept that a pencil sketch conversion, which keeps gray tones instead of thresholding to pure black and white, suits that photo better.
The PDF takes its orientation from the photo
The PDF branch hands the traced PNG to pdf-lib, which reads the bitmap’s own
pixel dimensions out of the file, then sizes a single page to A4 or US Letter
and flips it to landscape when the photo is wider than it is tall. The image is
scaled by whichever axis runs out of room first and centered, so aspect ratio is
preserved, nothing is cropped, and you get white margins rather than a stretched
subject. The PNG option skips all of that and keeps the trace at the photo’s
original resolution for editing or printing at a size you choose yourself.
Batches, cancelling, and the one file that stops everything
Files are processed strictly one after another, and there is no per-file error handling anywhere in the chain. A single image the browser refuses to decode takes down the entire run, and you get a generic failure message rather than a list of which file was at fault. Cancelling behaves the same way: the partial results are discarded along with the contents of the dropzone. Neither is a disaster with five holiday photos, but it is worth knowing before you queue up forty.
If you are assembling a whole activity pack, the printable maze generator and the handwriting practice sheets produce PDFs on the same paper sizes, and the rest of the image tools hub covers the cropping and resizing you might want to do to a photo before tracing it.

