All posts

Recreating distressed ink print textures with shaders

Turning a Photoshop effect into a real-time shader that transforms photographs into grainy, distressed prints with uneven ink, rough edges and adjustable textures.

4 min read

I've always liked the look of distressed prints. The uneven ink, rough edges and grain give an image a quality that a perfectly clean digital image doesn't have. It's a bit imperfect, but in a way that makes the image more interesting.

For a long time, I've recreated this look in Photoshop using the same three filters: Field Blur, Graphic Pen and Torn Edges. It's a fairly simple process, but the combination works surprisingly well.

Recently, I decided to turn it into a shader.

From filters to shader

The idea was to take something I already knew how to make and see what would happen if I made it interactive.

Instead of running a series of filters on a flattened image, I wanted to be able to change the effect itself. Move the focal point, change the texture, adjust how much ink covers the image, or change the colors entirely. All without having to start over.

I first built it in Figma, then brought it to my website. It now runs directly on the image, with the settings exposed as controls.

The result is much more flexible than the original Photoshop routine. A photograph can become a fine, grainy print or something much heavier, with large patches of ink and barely any detail left in the highlights.

Making it work

The original process is still the foundation. Blur the image, break it into pen strokes, then tear those strokes into irregular patches.

What makes the shader interesting is that these steps are no longer fixed filters. Each one has its own parameters, and they interact in ways that aren't always obvious until you start playing with them.

The blur, for example, isn't completely uniform. Noise breaks it up so that some areas soften more than others. The pen strokes use directional noise to create streaks, while the final pass merges them into larger patches and roughens their edges.

Most of the work was in finding a balance between preserving the original image and letting the texture take over. Too much detail and it looks like a regular photograph with a filter applied. Too little, and the image becomes an indistinguishable mass of ink.

Playing with it

10.8 px
1.00
0.0 px
0.33
The look, with four of its settings handed to you. Drag the picture to move the sharp spot.

These are the four settings that have the biggest impact on the result.

Blur controls how far the image softens around the focal point.

Stroke length determines whether the texture looks like fine grain or longer pen strokes.

Clump size changes the scale of the ink patches.

Ink weight determines how much of the image remains visible.

The focal point is draggable, so the effect can be directed toward a particular part of the image rather than applied uniformly.

I like that the same settings can produce such different results depending on the photograph. It's a small effect, but one that gives me another way to work with images on the site.

The shader runs in WGSL on WebGPU, with a WebGL version for the demos.

Try it in FigmaDistressed Ink on the Figma Community

– Joan