Dither Portrait
A photo for your about page as a dither print that comes up the way paper does in the darkroom tray: shadows first, then the midtones, the highlights last. A loupe follows the cursor and shows the real photo through it, or drag a divider across to compare the two.
Needs: None. A 2D canvas. The photo must be same-origin or CORS-enabled so its pixels can be read.
Demo photo by Jennifer Trovato on Unsplash
Customize
shape
mode
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | required | The photo. Same-origin or CORS-enabled. |
| alt | string | required | What's in it, for screen readers. |
| cell | number | 3 | Size of one dither pixel in px. |
| shape | "square" | "dot" | "square" | Square pixels, or round dots like a halftone. |
| color | boolean | false | Each dot takes the photo's own colour there, rather than the ink. |
| mode | "lens" | "split" | "lens" | A loupe that follows the cursor, or a divider you drag across. |
| developing | boolean | true | The print develops when it first comes into view, shadows first. |
| duration | number | 2.6 | Seconds the print takes to come up. |
| lens | number | 150 | The loupe's diameter in px. |
| zoom | number | 1.6 | How much the loupe magnifies. |
| interactive | boolean | true | The loupe or the divider. Off shows just the print. |
| className | string | – | Class on the root, which fills its parent. |
| style | CSSProperties | – | Style on the root. |