Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Remove references to Photon Studio from docs, AGENTS.md and code comments

Brandon Thomas9c9a680e45b9
diff --git a/AGENTS.md b/AGENTS.md
index fd7bfa2e9..f4904581e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -41,7 +41,7 @@ xtask/ cargo xtask layers | wasm | ci | stats | corpus | p
1. **Everything is a command.** New user-visible behaviour = a command in the engine (`crates/engine/src/*_cmds.rs`, registered in `commands.rs`) with id, label, menu path, shortcut, params doc, `enabled` and `run`, plus tests. The UI, CLI, control channel and MCP all dispatch commands by id. Use the **exact id from `crates/ui-egui/src/menu_catalog.rs`** and the menu item goes live automatically. Only pure view/window state (zoom, panels, screen mode) belongs to the shell (`menus.rs` `UI_COMMANDS`).
2. **No format or colour assumptions.** Bit depth (8/16/32f) and colour model (RGB/Gray/CMYK/Lab…) are runtime data. Never introduce a `u8`-only pixel path in public APIs. Never assume sRGB: colour conversions go through `photocraft-cms` (`Transform`, `transform::cached`). Test at several depths.
-3. **Clean-room.** We studied Photon Studio (proprietary) and Photoshop for *behaviour and look only*. Never copy their code, shaders, profiles or assets. Implement from public specs (Adobe PSD spec, ICC, ISO 32000 blend modes, papers) and observation. Third-party assets must be permissively licensed and recorded (see `assets/`, `docs/images/SOURCES.md`).
+3. **Clean-room.** We studied Photoshop and other proprietary editors for *behaviour and look only*. Never copy their code, shaders, profiles or assets. Implement from public specs (Adobe PSD spec, ICC, ISO 32000 blend modes, papers) and observation. Third-party assets must be permissively licensed and recorded (see `assets/`, `docs/images/SOURCES.md`).
4. **Tests are the gate.** Every change comes with tests. Format crates use round-trip, synthetic-generator, oracle and fuzz tests. Keep the PSD corpus results and the parity floor (`crates/ui-egui/src/parity.rs`) from regressing.
5. **The UI is thin and data-driven.** UI state lives in `ui-egui/src/state.rs` (serde), so the control channel can read and drive it. Colours and radii come from `theme::Tokens`, never hard-coded.
6. **Verify UI changes visually.** Render offscreen with `cargo run -p photocraft-ui-egui --example snapshot` (no window, no focus stealing), or launch with `--control` and take `ui.screenshot`. Look at the PNG. Demo images must be public-domain art, never personal photos. When fetching assets, never put a person's name, email or other personal details in requests (User-Agent, headers, URLs); use a generic `Photocraft-dev` User-Agent.
diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs
index a579da098..c0a9aa505 100644
--- a/crates/ui-egui/src/panels.rs
+++ b/crates/ui-egui/src/panels.rs
@@ -1454,14 +1454,14 @@ pub fn adjustment_values(a: &photocraft_doc::Adjustment) -> Value {
/// Floating Properties card anchored to the canvas' top-right corner.
pub fn properties_window(app: &mut PhotocraftApp, ctx: &egui::Context) {
- // Pro (Photoshop) docks Properties; Studio (Photon) floats it over the canvas.
+ // Pro (Photoshop) docks Properties; Studio floats it over the canvas.
if !app.ui.panels.properties || Tokens::get(ctx).pro {
return;
}
let Some(st) = app.session.active() else { return };
let Some(id) = st.active_layer else { return };
let Some(layer) = st.doc.layer(id).cloned() else { return };
- // Like Photon: the floating card appears for adjustment and fill layers (their controls live here).
+ // The floating card appears for adjustment and fill layers (their controls live here).
if !matches!(layer.content, LayerContent::Adjustment(_) | LayerContent::Fill(_)) {
return;
}
diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs
index 2d90531e3..cd155be67 100644
--- a/crates/ui-egui/src/theme.rs
+++ b/crates/ui-egui/src/theme.rs
@@ -1,7 +1,7 @@
//! Design system: themes, colour tokens, radii, typography.
//!
//! - **Studio** (default): near-black surfaces, rounded cards, Inter + JetBrains Mono, soft violet
-//! accent. Modelled on the look of modern pro editors (Photon Studio, Photoshop 2025).
+//! accent. Modelled on the look of modern pro editors (such as Photoshop 2025).
//! - **Studio Light**: the same system on light surfaces.
//! - **Classic**: a deliberately Windows-2000-era look (grey bevels, square corners, navy selection)
//! for people who prefer it.
diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs
index d661322d3..51e9ff6e4 100644
--- a/crates/ui-egui/src/widgets.rs
+++ b/crates/ui-egui/src/widgets.rs
@@ -111,7 +111,7 @@ pub fn pill_tab(ui: &mut Ui, label: &str, selected: bool) -> Response {
resp
}
-/// Monospace numeric field with a dimmed unit suffix, Photon/Photoshop style. Drag to scrub.
+/// Monospace numeric field with a dimmed unit suffix, Photoshop style. Drag to scrub.
pub fn value_field(ui: &mut Ui, value: &mut f32, range: std::ops::RangeInclusive<f32>, suffix: &str, width: f32) -> Response {
let t = Tokens::get(ui.ctx());
let (rect, _) = ui.allocate_exact_size(vec2(width, 24.0), Sense::hover());
@@ -228,7 +228,7 @@ pub fn slider_row(ui: &mut Ui, label: &str, value: &mut f32, range: std::ops::Ra
r
}
-/// iOS/Photon-style toggle switch.
+/// iOS-style toggle switch.
pub fn toggle(ui: &mut Ui, on: &mut bool, label: &str) -> Response {
let t = Tokens::get(ui.ctx());
if t.pro {
@@ -257,7 +257,7 @@ pub fn toggle(ui: &mut Ui, on: &mut bool, label: &str) -> Response {
resp
}
-/// Big white primary button (Photon "OK" style).
+/// Big white primary button.
pub fn primary_button(ui: &mut Ui, label: &str, min_width: f32) -> Response {
let t = Tokens::get(ui.ctx());
button_impl(ui, label, min_width, t.primary_bg, t.primary_text, true)
@@ -336,7 +336,7 @@ pub fn hue_stops() -> Vec<Color32> {
.collect()
}
-/// A compact labelled dropdown with Photon styling.
+/// A compact labelled dropdown in the studio style.
pub fn dropdown<T: PartialEq + Clone>(ui: &mut Ui, id: &str, current: &mut T, options: &[(T, &str)], width: f32) -> bool {
let label = options.iter().find(|(v, _)| v == current).map(|(_, l)| *l).unwrap_or("—");
let mut changed = false;
diff --git a/docs/architecture.md b/docs/architecture.md
index a7049d0c9..da7eb37d2 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -13,7 +13,7 @@ This plan sets out:
## 1. Goals and principles
**Goals**
-- A native, portable (macOS / Windows / Linux), fully open-source layered image editor, roughly matching Photon Studio's and Photoshop's feature surface over time.
+- A native, portable (macOS / Windows / Linux), fully open-source layered image editor, roughly matching Photoshop's feature surface over time.
- **The UI can be swapped** without touching the core: egui today, maybe Slint, Qt or something else later.
- **The core compiles to `wasm32`,** which keeps a browser demo possible.
- PSD read and write lives in its **own crate that can be published separately.**
@@ -21,13 +21,13 @@ This plan sets out:
**Principles**
1. **Engine-first, headless-first.** Every feature is reachable without a GUI: from tests, the CLI and MCP. The GUI is one client of the engine.
-2. **Everything is a command.** Each user-visible action has a stable `CommandId` (such as `filter.blur.gaussian`) with typed, serializable parameters. The menu, command palette, shortcuts, recorded actions/macros, CLI, MCP and plugins all dispatch the same commands. Photon does this, and it is the single best architectural idea in that app. Its 720-item menu tree ([`photon-studio/06-menu-snapshot.md`](photon-studio/06-menu-snapshot.md)) is effectively our feature backlog.
+2. **Everything is a command.** Each user-visible action has a stable `CommandId` (such as `filter.blur.gaussian`) with typed, serializable parameters. The menu, command palette, shortcuts, recorded actions/macros, CLI, MCP and plugins all dispatch the same commands.
3. **Data describes the UI; toolkits draw it.** Tools produce *overlay primitives* (lines, handles, marching-ants paths) as data. Filter and adjustment dialogs are generated from *parameter schemas*. A new toolkit implements one renderer for each, not about 150 bespoke dialogs.
-4. **One algorithm, one parameter struct.** Every algorithm has a CPU reference implementation (Rust + rayon, deterministic). Some also get a GPU implementation (WGSL). Both read the same `#[repr(C)]` `bytemuck::Pod` parameter struct. Photon keeps TypeScript, WASM, WGSL and C++ copies in sync by hand, and we will not repeat that.
+4. **One algorithm, one parameter struct.** Every algorithm has a CPU reference implementation (Rust + rayon, deterministic). Some also get a GPU implementation (WGSL). Both read the same `#[repr(C)]` `bytemuck::Pod` parameter struct. We never keep hand-synced copies of an algorithm in several languages.
5. **Immutable snapshots, copy-on-write tiles.** Pixel data is stored in `Arc`-shared 256² tiles. Taking a document snapshot is O(layers), which makes undo, background jobs, autosave and UI reads cheap and lock-free.
6. **Determinism.** The same input gives the same output across CPU and GPU (within tolerance), across thread counts, and between preview and export. Noise is hashed from document coordinates.
7. **Pure Rust by default.** C/C++ dependencies are allowed only behind Cargo features, in I/O-edge crates (for example HEIF, or an optional LibRaw).
-8. **Clean-room with respect to Photon Studio.** Photon is proprietary freeware. We studied its *behaviour and architecture*, and we must **not copy its source** (Rust, WGSL, C++ or JS), even though parts of it ship as readable source. Specs come from public format docs (Adobe PSD spec, ISO/ICC), academic papers (PatchMatch, Poisson blending, ARAP) and observed behaviour. Contributors should not paste from the extracted bundle.
+8. **Clean-room.** We study other editors' *behaviour* only, and we must **not copy proprietary source** (Rust, WGSL, C++ or JS), even where it ships as readable source. Specs come from public format docs (Adobe PSD spec, ISO/ICC), academic papers (PatchMatch, Poisson blending, ARAP) and observed behaviour. Never paste code from another product.
### 1.1 Avoiding GIMP's hole
@@ -426,10 +426,10 @@ psd/src/
- **`automation`:** an MCP server built on `rmcp`. It exposes:
- `session.list`, `doc.open`, `doc.save`, `doc.export`, `doc.inspect` (layer tree as JSON), `doc.render_preview` (PNG).
- `command.list` and `command.run(id, params)`, both generated from the registry.
- - Stdio for agent CLIs, and optionally loopback TCP with a token so it can attach to a running GUI. Photon does exactly this with Claude Code, Codex and Cursor, and it's worth copying the idea.
+ - Stdio for agent CLIs, and optionally loopback TCP with a token so it can attach to a running GUI.
- **Actions:** recorded `Vec<CommandInvocation>`, replayable in batch (File → Automate → Batch).
- **Scripting (later):** embed a scripting language over the same registry. Options are Rhai, or Lua via mlua (C). JS via QuickJS is possible if we want Photoshop-script familiarity.
-- **Plugins (later):** a WASM component-model plugin API (wasmtime) for filters and panels. It is sandboxed and portable, and fits the command/schema model. Photoshop CEP/UXP/8BF compatibility (which Photon attempts) is explicitly out of scope for v1.
+- **Plugins (later):** a WASM component-model plugin API (wasmtime) for filters and panels. It is sandboxed and portable, and fits the command/schema model. Photoshop CEP/UXP/8BF compatibility is explicitly out of scope for v1.
---
diff --git a/docs/contributing.md b/docs/contributing.md
index 7f6efa613..07797c74f 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -2,7 +2,7 @@
- **Language:** Rust only. No JavaScript or TypeScript. On the web, `wasm-bindgen` generates a small loader; never hand-write JS.
- **Licence:** contributions are MIT OR Apache-2.0 (workspace default; see `plan/` for the pending licence decision).
-- **Clean-room:** do not copy code, shaders, icons, ICC profiles or other assets from proprietary software (Photon Studio, Photoshop). Match behaviour and look by observation and public specs. Only use assets with permissive licences, and record them next to the asset (e.g. `assets/fonts/OFL-*.txt`, `assets/icons/LICENSE-lucide.txt`, `docs/images/SOURCES.md`).
+- **Clean-room:** do not copy code, shaders, icons, ICC profiles or other assets from proprietary software (such as Photoshop). Match behaviour and look by observation and public specs. Only use assets with permissive licences, and record them next to the asset (e.g. `assets/fonts/OFL-*.txt`, `assets/icons/LICENSE-lucide.txt`, `docs/images/SOURCES.md`).
- **Commands, not handlers:** new features are engine commands with tests, and the UI calls them (checklist below).
- **Layering:** `cargo xtask layers` must pass. Register new crates in `xtask/src/layers.rs`.
- **Tests:** required for every change. Format code needs round-trip and malformed-input tests. Pixel code is tested at 8, 16 and 32-bit.
diff --git a/docs/ui-design.md b/docs/ui-design.md
index 7e69a01d3..9165ddb12 100644
--- a/docs/ui-design.md
+++ b/docs/ui-design.md
@@ -5,7 +5,7 @@
| Theme | Intent |
|---|---|
| **Pro** (default) | Photoshop-style Spectrum dark: flat charcoal panels (#323232), dark tab strips, Spectrum blue accent (#378ef0), pill buttons, checkboxes, compact 12 px type |
-| Studio | Photon-style: near-black, rounded cards, pill tabs, violet accent, toggles |
+| Studio | Dark studio style: near-black, rounded cards, pill tabs, violet accent, toggles |
| Studio Light | Studio on light surfaces |
| Classic | Windows-2000 bevels, square corners, navy selection |