aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 63f3eba0c75c37bbcf3e7395a7e82bbff5112832 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Atelier

A layered image editor that runs entirely in the browser. Plain ES modules, no build
step, no third-party dependencies.

## Running

The deployable app lives in `build/`: it is self-contained, and since there's no build step it
is also the source. ES modules can't load from `file://`, so serve it over HTTP:

```sh
node serve.js                          # http://localhost:8080/ (serves build/)
# or: python3 -m http.server 8080 -d build
```

To deploy, point any static file server at `build/`. The app is a single page with relative
asset paths, so it also works from a subpath.

## Features

**Tools**: Move, Free Transform (scale / rotate / flip), Rectangle and Ellipse select, Lasso
(freehand and polygonal), Magic Wand, Crop, Eyedropper, Brush, Pencil, Eraser, Clone Stamp,
Smudge, Dodge / Burn / Sponge, Paint Bucket, Gradient (linear / radial / angle / reflected), Text, Shapes (rect,
rounded rect, ellipse, line, arrow, polygon, star), Hand, Zoom.

- Brushes have size, hardness, opacity, flow, spacing, smoothing, pressure, and a blend mode.
  Brush, Pencil and Eraser can mirror strokes left/right, top/bottom, 4-way, or radially
  (6 or 8 copies) around the canvas center.
- Selections can be combined (Shift adds, Alt subtracts, Shift+Alt intersects), feathered,
  expanded or contracted, bordered, smoothed, inverted, moved, and built from color range or
  from a layer's pixels.

**Layers**: unlimited raster layers plus editable text layers. Each layer has visibility,
opacity, 17 blend modes, a lock, a transparency lock and a clipping mask. Layer masks can be
painted on directly, disabled, applied or deleted. You can reorder layers by dragging, rename
them, merge down, merge visible, flatten, create a new layer by copying or cutting the
selection, and align a layer to the selection or the canvas.

**Layer styles**: non-destructive Drop Shadow, Outer Glow, Inner Shadow, Color Overlay and
Stroke (inside, center or outside), edited in a dialog with live preview. Styles follow the
layer's pixels and mask as you paint, can be copied between layers, and are baked in when you
merge or export.

**Rulers, guides and snapping**: View ▸ Rulers (Ctrl+R) shows rulers; drag from them to add
guides, and drag guides with the Move tool (back onto a ruler to delete them). Selections,
crops, shapes, gradients and moved pixels snap to guides, the grid and the canvas edges and
center. Guides are saved with the project and follow rotate, flip, crop and resize.

**Color**: an HSV picker with alpha, hex/RGB/HSV inputs and saved swatches. Foreground and
background colors work like Photoshop's (X swaps them, D resets them).

**Adjustments**: Brightness/Contrast, Hue/Saturation (with colorize), Levels, Curves, Color
Balance, Exposure, Vibrance, Temperature/Tint, Gradient Map, Black & White, Sepia,
Posterize, Threshold, Invert, Desaturate, Auto Contrast, Auto Color, Equalize.

**Dithering** (Image ▸ Adjustments ▸ Dither): reduce a layer to a restricted palette. The
default is hard 1-bit black and white. Luminance mode takes 2 to 64 levels, either black to
white or foreground to background. RGB mode sets the levels for each channel separately
(3/3/2, for example). Built-in algorithms are error diffusion (Floyd–Steinberg, Atkinson,
Jarvis–Judice–Ninke, Stucki, Burkes, Sierra, Two-Row Sierra, Sierra Lite), ordered patterns
(Bayer 2 to 16, halftone dots, line screen, blue noise, interleaved gradient noise) and
seeded random noise. Options cover diffusion strength, serpentine scan, pattern scale,
brightness and contrast, dithering in linear light, and hard-edged transparency.

*Dither scripts*: you can write your own algorithm in JavaScript (Image ▸ Adjustments ▸ Dither
Scripts, or the Scripts… button in the Dither dialog). A script gets the tones as a
Float32Array plus helpers for custom diffusion kernels, threshold matrices or functions, and
nearest-level lookups. Scripts run in a Web Worker and are stopped after 30 s. Whatever a
script writes is snapped to the allowed levels. Scripts are stored in the browser and can be
loaded from or saved to `.js` files. They are compiled with `new Function`, so a
Content-Security-Policy on the server needs `'unsafe-eval'` for them (built-in algorithms
don't).

**Filters**: Gaussian, Motion and Radial blur, Unsharp Mask, Sharpen, Add Noise, Median,
Pixelate, Emboss, Find Edges, Vignette, Soft Glow, Chromatic Aberration, Wave, Twirl, and
Pinch/Bulge. Filters have a live preview and apply only inside the selection when one exists.

**Image operations**: Image Size, Canvas Size (with anchor), rotate, flip, crop to selection,
trim, and duplicate.

**Files**
- **Open**: PNG, JPEG, GIF, WebP, BMP, ICO, AVIF and SVG through the browser's decoders,
  and TIFF through a built-in decoder (uncompressed, LZW and PackBits). You can also
  drag and drop files, or paste from the clipboard.
- **Projects** (`.atelier`): a binary container with a JSON manifest and a PNG for each layer,
  mask and selection. It keeps every layer, text layer, mask and blend setting.
- **Export**: PNG, JPEG, WebP, AVIF (when the browser supports it), GIF (median-cut and
  k-means palette, optional dithering), BMP (24- or 32-bit), TIFF (PackBits) and ICO
  (multi-size). Export can rescale the image and shows the estimated file size.
- **Autosave**: unsaved work is stored in IndexedDB every 30 s and offered back on the next start.

**Other**: multiple documents in tabs, a history panel (drag its top edge to resize), a
navigator, a pixel grid and a configurable grid, recently used colors, dark, light and
system-matched themes, and keyboard shortcuts (F1 lists them).

- **Movable dialogs**: drag any dialog by its title bar to see the canvas underneath. A moved
  dialog stops dimming the screen, so live previews show true colors. Clicking outside it no
  longer cancels it. It reopens in the same place, and double-clicking the title bar recenters it.
- **Command palette** (Ctrl+K): fuzzy search across every menu command and tool.
- **Preferences** (Ctrl+,): theme, wheel behaviour, pixel grid, file dialogs, autosave and
  the number of history steps.
- **Keyboard menus**: F10 opens the menu bar; arrows, Enter, Esc and first letters navigate.
- **Touch**: pinch with two fingers to zoom and pan.

## Development

```sh
dev/test.sh            # headless Chromium suites (functional, tools, ui, features)
```

The suites use `dev/cdp.js`, a small DevTools-protocol client. They need `chromium` on PATH.

See `CLAUDE.md` for an architecture overview.