Pardigon
I designed it and shipped the first version in a few days, with 0 runtime dependencies.
An open-source library to add film grain to websites, using the GPU.
- Role
- Creator & Creative Technologist
- Context
- Open-source project
- Period
- - Present
- Location
- Tokyo
TL;DR
Digital images feel too clean. In motion design or video editing, I fix that with a layer of film grain. I wanted the same on websites, but nothing I found gave me full control over it.
So I built Pardigon, a small TypeScript and WebGL2 library. A GLSL shader draws the grain live on the GPU: no noise texture to load, no pixels computed on the CPU.
I decided what it should do and how the grain should look and move, tested every feature and created the presets.
It has 23 options and it's open source, so anyone can add it to their own site today.
8mm
The problem
After 10+ years in creative direction, I know a subtle layer of grain makes a big difference. It brings motion, and with it, life. Visuals feel more organic.
For websites, I wanted direct and complete control over it: size, strength, color, detail and movement.
My role
I came up with Pardigon and directed Claude Code to build it. I decided how much it can ask of a phone and defined its public API: the options and methods a developer uses.
main.ts
import { createGrain } from "pardigon";const grain = createGrain( { target: document. body, preset: "8mm", quality: "auto", respectReducedMotion: true, // animationMode: "flow", // fps: 24, // mask: "text",});Key decisions
Fog moves, film grain stays
My first fog preset drew a new noise pattern every few frames. It looked less like fog, more like a broken TV.
Real fog drifts slowly. So I made it travel across the frame, softly changing shape as it goes.
Film grain works the other way around. It stays in place and changes over time.
That's where Pardigon's two animation modes come from. flow moves the texture. evolve changes it in place.
Flow
Grain as a material
When I made the grain large and blurry, it lost its detail: just big, soft blocks.
So I added controls for its shape. complexity brings back finer detail. character groups the grain into clusters, with calmer areas in between. scaleX and scaleY stretch it in each direction, even into wide, thin lines.
A frame rate for each film stock
Timing changes how a texture feels.
At the screen's frame rate, my 8mm preset felt too modern. Real 8mm film runs much slower.
So Pardigon runs the grain at its own frame rate, separate from the screen. Each film stock preset gets its own, and 8mm is the slowest.
continuity sets how the grain changes between frames, from a brand new pattern every frame to a smooth shift.
12 FPS
The right imperfections
Old film isn't perfectly stable. So I added two imperfections. flicker makes the brightness waver. dirt leaves marks that come and go.
I kept both subtle and used them only on the 8mm and 16mm presets. Those two now feel closer to real film. The cleaner presets stay untouched.
flicker also switches off when a visitor has reduced motion turned on.
8mm
Grain that belongs to the image
I wanted the grain to work with the image.
So Pardigon can read an image or a video and put more grain in its shadows, midtones or highlights.
It can also keep the grain inside one area of the page, or inside the letters of a line of text. The text stays real text, so screen readers can still read it.
To keep the result consistent and spare the CPU, it only reads the image you give it. Never the whole page.
Pardigon
Smooth on a phone
A visual effect shouldn't make a website feel slow. I tested Pardigon on both desktop and mobile, including recent iPhones with high-resolution screens.
Those tests led to an automatic quality mode: when frames start to lag, Pardigon lowers its internal resolution, detail and frame rate. Once the device catches up, it returns to full quality.
Low Power Mode on an iPhone can also slow the whole browser down. So before lowering quality, Pardigon checks that it actually helps. If it doesn't, it keeps full quality.
It never touches your creative settings: the grain keeps the size, color and movement you chose. Every demo on this page runs in that mode.
What it shows
Pardigon takes a texture I've used for years in video and turns it into a tool any developer can add to a site in a few lines.
- 6
- presets: three film stocks, paper, pixel and fog
- 23
- options in its public API
- 0
- runtime dependencies
- Published on npm under the MIT license
About the name
Pardigon is named after Après-midi à Pardigon, painted in 1907 by the French Neo-Impressionist Henri-Edmond Cross.
Cross built the landscape from small touches of color. Seen together, they make light, depth and atmosphere. Pardigon follows the same idea: many small variations, one texture.
The painting's Mediterranean light also inspired Pardigon's colors. They frame every demo on this page.
Next steps
Next, I want to go deeper on film: more procedural noise functions, and film stocks that behave even more like the real thing.
I also want to try a WebGPU renderer, with WebGL2 staying the main version.