---
title: "Ink Gain · Playground · Drew Minns"
description: "Type that looks pressed into paper, slightly different every pull."
url: https://reallygood.work/playground/ink-gain/
---

Playground · 03

# Ink Gain

Type that looks pressed into paper, slightly different every pull.

Every _pull_.

Pressure

0.82

Specks

0.50

Boil

Words

How it works

A short chain of SVG filters: noise wobbles the edge, a blur lets it swell, a curve sharpens it back up, and a second noise knocks out specks where the ink didn't take.

The noise seeds change on every pull, so the edge is never quite still.

```html
<!-- ink gain: wobble the edge, let it swell, knock out specks where the ink didn't take -->
<filter id="ink-gain">
  <feTurbulence type="fractalNoise" baseFrequency="0.035" numOctaves="2" result="wobble"/>
  <feDisplacementMap in="SourceGraphic" in2="wobble" scale="5.9"/>
  <feGaussianBlur stdDeviation="1.55"/>
  <feComponentTransfer><feFuncA type="linear" slope="5" intercept="-0.63"/></feComponentTransfer>
</filter>
```

Make it yourself

The whole thing in one file, with no libraries. Save it as an .html file and open it. The settings at the top follow the controls above, so tune it there, then copy.

ink-gain.html

```html
<!doctype html>
<meta charset="utf-8">
<title>Ink Gain</title>
<style>
  body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: #ede9df; color: #15130f; }
  h1 { margin: 0; font: 500 clamp(48px, 10vw, 140px)/1 Georgia, serif; filter: url(#ink-gain); }
</style>

<!-- ink gain: wobble the edge, let it swell, sharpen it back up, knock out specks where the ink didn't take -->
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
  <filter id="ink-gain" x="-6%" y="-12%" width="112%" height="124%" color-interpolation-filters="sRGB">
    <feTurbulence class="seed" type="fractalNoise" baseFrequency="0.035" numOctaves="2" seed="1" result="wobble"/>
    <feDisplacementMap id="wobble" in="SourceGraphic" in2="wobble" xChannelSelector="R" yChannelSelector="G" result="moved"/>
    <feGaussianBlur id="swell" in="moved" result="soft"/>
    <feComponentTransfer in="soft" result="shape"><feFuncA id="edge" type="linear" slope="5"/></feComponentTransfer>
    <feTurbulence class="seed" type="fractalNoise" baseFrequency="0.85" numOctaves="1" seed="3" result="specks"/>
    <feColorMatrix id="specks" in="specks" type="matrix" result="mask"/>
    <feComposite in="shape" in2="mask" operator="in"/>
  </filter>
</svg>

<h1 id="words"></h1>

<script>
const settings = {
  pressure: 0.82,   // how hard the plate presses: the ink wobbles and swells more
  specks: 0.5,       // how much of the ink fails to take
  boil: true,           // a fresh pull 25 times a second, so the edge never sits still
  text: 'Every pull.',
};
document.getElementById('words').textContent = settings.text;

// one pressure value drives the whole chain
const p = settings.pressure, threshold = (0.40 - p * 0.22) * settings.specks * 2;
document.getElementById('wobble').setAttribute('scale', 1 + p * 6);              // how far the edge wanders
document.getElementById('swell').setAttribute('stdDeviation', 0.4 + p * 1.4);    // how much it spreads
document.getElementById('edge').setAttribute('intercept', -1.7 + p * 1.3);       // where the soft edge is cut back to sharp
document.getElementById('specks').setAttribute('values', `0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  12 0 0 0 ${-12 * threshold}`);

// every pull reseeds the noise, so no two frames are alike
const seeds = document.querySelectorAll('.seed');
let frame = 0;
if (settings.boil && !matchMedia('(prefers-reduced-motion: reduce)').matches) {
  setInterval(() => { frame = (frame + 1) % 9; seeds.forEach((s, i) => s.setAttribute('seed', frame + 1 + i * 11)); }, 40);
}
</script>
```

-   [Previous piece — Two-Ink Dither](https://reallygood.work/playground/two-ink-dither/)
-   [Next piece — Dot Chart](https://reallygood.work/playground/dot-chart/)
