What does the pencil effect do?
The pencil effect converts a photograph into something that reads as a pencil drawing. It works the way image editors have done it for decades: the picture is reduced to grayscale, a copy is inverted and blurred, and the two are recombined with a colour-dodge blend that divides one by the other. Wherever the image is darker than its surroundings the division produces a dark line, and wherever the tone is even it cancels out to white. What remains is edges, which is what a pencil drawing is made of.
Two controls shape the result. The blur radius in the inverted copy sets how much detail survives: a narrow radius keeps the fine texture a soft pencil would catch, while a wide one suppresses everything but the strongest boundaries and reads as a bold charcoal study. That is why it is labelled line weight rather than blur — the radius is the mechanism, but what changes on screen is how heavy the lines look. The strength slider blends the sketch back towards the grayscale photograph, leaving a tinted drawing at the low end and lines on white at the high end.
An optional checkbox multiplies the original colour back through the lines for a coloured-pencil look. It is a reasonable imitation rather than a faithful one, because the shading follows the photograph rather than a pencil stroke, so faces and flat areas pick up the tone of the source. Everything runs in this page on a canvas, and the working size is capped at 2400 pixels on the long edge — large enough for a usable result, small enough that moving a slider stays responsive.
How to turn a photo into a pencil sketch
- Click the drop area and choose an image — a JPEG, PNG or WebP, up to 30 MB.
- Set the line weight, and watch how a wider blur drops fine detail and leaves only the strongest outlines.
- Adjust the strength: low values keep more of the photograph and read as a drawing on tinted paper, high values leave clean lines on white.
- Tick the colour box for a coloured-pencil look, or leave it off for graphite.
- Press Draw the sketch and check the result against the photograph beside it.
- Download the PNG, or change a control and draw again — the original image is never modified.
Image Pencil Effect limits and rules
| Item | Limit |
|---|---|
| Input formats | Anything the browser can decode, which is JPEG, PNG, WebP, GIF and often AVIF |
| Input size | Up to 30 MB, chosen because every pixel is held in memory during the blur |
| Working size | Scaled down to at most 2400 pixels on the long edge |
| Line weight | A blur radius from 1 to 20 pixels, applied twice to approximate a Gaussian |
| Strength | 30% to 100%, blending the sketch towards the grayscale source |
| Output | A flattened PNG; there are no layers to edit afterwards |
| Not covered | Strokes that follow paper texture, hatching, or any effect that is not edge-based |
When to use it
- Turning a portrait into a sketch for an avatar or a print.
- Making a drawing-like illustration from a photograph for a card or a poster.
- Producing a coloured-pencil version of a landscape for a design mock-up.
- Softening a photograph so it can sit beside text without competing with it.
- Making a distinctive header image from a stock photo without a licence question about the result.
Is it private?
The image is decoded, blurred and drawn by JavaScript in this page. Nothing is uploaded, stored or logged, which you can confirm by watching the network tab stay empty while the sketch is produced.
Frequently asked questions
Because of how the blend behaves in mid-tones. Colour-dodge divides the grayscale by the inverted blur, and where the two are close the division does not reach pure white — a large, evenly lit area such as a wall or a sky can retain a light haze. Raising the strength pushes the result towards white and hides it, and a slightly wider blur reduces it further by flattening the tone difference the division is working on. If a particular area stays grey, it is usually a region with detail the effect is still responding to.
Line weight is the blur radius, so it decides which edges survive at all: a wide blur removes fine texture and leaves only major boundaries, giving bold sparse lines. Strength is a blend factor applied afterwards, deciding how strongly the surviving lines are drawn against the grayscale underneath. In practice, adjust weight first to choose how much detail you want, then strength to choose how heavily it is inked. Turning one up and the other down does not give the same result.
Because the blur is run twice horizontally and twice vertically over every pixel, and that cost grows with the square of the image size. A modern phone photograph is several thousand pixels across, which would make each slider movement take seconds. Capping the long edge at 2400 pixels keeps the interaction responsive while still producing a file larger than most web and print uses need. The cap is on the working copy; your original file is untouched.
Not from this, and it is worth being clear about why. This effect is edge-based: it finds boundaries and draws them. Real pencil work also has hatching, paper texture, varied stroke direction and pressure, and none of those come from a blur and a division. Tools that produce them generally build a stroke model, which is a different and much heavier approach. What you get here is the classic pencil-sketch filter, which is convincing at small sizes and clearly digital when examined closely.
No — it multiplies the original hue through the computed line value, so the colour is modulated by the shading rather than kept intact. That produces a plausible coloured-pencil look, with the tone of the photograph visible in the shaded areas and white paper in the flat ones. If the result looks muddy, reducing strength keeps more of the original tone; if it looks like a tinted photograph, increasing weight will strip the detail back to lines and let the colour read as pencil rather than paint.
Because the result is mostly flat white and thin grey lines, which is exactly what JPEG compresses badly — it would introduce ringing around every edge and slightly muddy the white. PNG stores it losslessly, so the lines stay crisp and the file is still small for an image of this kind. If you need a JPEG for a size limit somewhere, the PNG can be converted afterwards, though it will be larger and slightly softer as a result.
Related tools
Written and maintained by Md. Nur Hossain Repon.