Skip to content

PhotoCraft: Clean-Room Photoshop in Pure Rust, wgpu & MCP

PhotoCraft (storytold/photocraft) is an open-source, clean-room Photoshop reimplementation in pure Rust with wgpu GPU compositing, PSD round trips, and native MCP.

Hoang Yell
Hoang Yell
11 min read
Tiếng Việt
PhotoCraft: Clean-Room Photoshop in Pure Rust, wgpu & MCP

Every few months, Adobe triggers another wave of collective developer outrage. One week it is terms of service updates implying your client artwork trains generative models; the next week it is a cancellation fee trap or a background telemetry daemon eating 4 GB of RAM while doing nothing. Yet millions of creators stay trapped because every open-source alternative feels like an alien operating system. GIMP forces you to rewire thirty years of keyboard muscle memory, while lightweight browser editors choke on multi-gigabyte production files.

PhotoCraft by Storytold challenges that monopoly with an audacious engineering premise: a clean-room reimplementation of Adobe Photoshop built in 100% pure, safe Rust. It features hardware-accelerated GPU compositing via wgpu, non-destructive adjustment layers, real PSD round-trip fidelity, and a native Model Context Protocol server that lets autonomous AI agents operate the entire application headlessly.


TL;DR

Quick Answer Box (Google Search Featured Snippet):

  • What is PhotoCraft? PhotoCraft (storytold/photocraft) is an open-source, clean-room desktop image editor that mirrors Adobe Photoshop’s interface, shortcuts, and PSD file format, written entirely from scratch in pure Rust (unsafe_code = "forbid").
  • Why does it matter? Unlike Electron wrappers or GIMP, PhotoCraft uses sparse 256x256 copy-on-write tiles on a native wgpu graphics pipeline. Every internal action maps to a unified command registry accessible via GUI, CLI, and native MCP for AI agents.
  • Current status: Early alpha (v0.2.x). Roughly 60% to 70% of Photoshop’s feature surface exists, with full PSD round trips for 169 of 170 test corpus files, but roughly 20 legacy tools and generative AI features are still pending.
  • Repository: storytold/photocraft (License: MIT / Apache-2.0, ~9.8k Stars)
  • Best for: Developers, digital artists, and AI agent builders who need native PSD editing, zero telemetry, offline execution, and scripted headless rendering.
  • Main trade-off: Daily professional parity sits around 25% to 35%. Advanced typography, CMYK soft-proofing print pipelines, and legacy third-party plugins (.8BF) are still missing or under active development.

Beginner Map (Mental Model)

Before inspecting the crate hierarchy, visualize PhotoCraft with a single physical metaphor:

The Architectural Metaphor: Traditional image editors treat a Photoshop document like a giant wet canvas that gets irreversibly smeared whenever you paint or apply a blur. PhotoCraft treats your document like an organized stack of transparent glass slides broken into a grid of miniature 256x256 sticky notes. If you tweak a Curve or smudge a shadow, only the modified sticky notes are duplicated, while your GPU re-projects the entire stack at 120 FPS.


Part 1: Foundations (The Ergonomic Tension)

The dirty secret of creative software is that interface ergonomics dictate platform lock-in far more than raw pixel algorithms. When a graphic designer hits Cmd+J (duplicate layer), Cmd+T (free transform), or taps numbers 1 through 0 to dial layer opacity, their spinal cord bypasses conscious thought.

GIMP failed to dethrone Photoshop for three decades not because its mathematical filters were bad, but because its interface violently punished standard muscle memory. It treated floating selections as second-class citizens, scattered layer modes across unintuitive submenus, and lacked real non-destructive adjustment layers.

PhotoCraft circumvents this historic pitfall by adopting Photoshop’s workflow directly:

  1. Familiarity by design: Panels, docks, tool strips, and keyboard shortcuts reside exactly where hands expect them.
  2. Non-destructive adjustment layers: 16 live adjustments (Curves, Levels, Vibrance, Black and White, LUT color lookups) sit above pixel data without baking permanent modifications.
  3. Layer styles that match: Drop Shadow, Inner Glow, Bevel and Emboss, and Stroke render matching Photoshop’s blending math.
  4. Clean-room pedigree: Implemented strictly from Adobe’s public format specifications and empirical behavior, with zero proprietary code or leaked assets.
Term Pocket Definition (3-6 words)
wgpu Hardware graphics abstraction layer (Vulkan/Metal/DX12)
CoW (Copy-on-Write) Duplicates memory only when modified
MCP (Model Context Protocol) Open socket standard for AI agents
VRAM High-speed dedicated GPU video memory
Oracle Test Comparing output against ground-truth baseline
LUT (.cube) Color lookup table for color grading

Part 2: Investigation (How It Works Under The Hood)

The engineering elegance of PhotoCraft lies in its separation of concerns. The project is decomposed into 24 distinct crates inside a Cargo workspace, enforcing modular boundaries at compile time.

1. Pure Safe Rust Invariant

In graphics and parsing software, developers often reach for unsafe blocks to squeeze out maximum memory performance. PhotoCraft takes the opposite stance:

# Cargo.toml workspace root
[workspace.lints.rust]
unsafe_code = "forbid"

The entire engine, including the binary PSD parser, color management system (CMS), and raster pipelines, enforces #![forbid(unsafe_code)]. Memory safety, buffer overruns, and use-after-free vulnerabilities are eradicated by design.

2. Sparse 256x256 Tiles and Copy-on-Write

When editing a 10,000x8,000 pixel billboard in 16-bit RGB, a single full-layer bitmap consumes over 480 MB of RAM. If an artist paints five brush strokes, storing five full raster snapshots would crash the host system within minutes.

PhotoCraft slices every layer into sparse 256x256 pixel tiles. If a brush affects an area of 500x500 pixels, the engine mutates only 4 to 9 tiles. Undo steps do not clone whole layers; they merely preserve pointers to unmodified tile arcs using reference counting. Memory consumption drops by up to 70% compared to legacy architectures.

3. Dual Compositor Verification

How do the authors ensure that hardware-accelerated shaders on Vulkan or Metal render pixels identically to Photoshop?

PhotoCraft maintains two distinct compositing engines:

  • The CPU reference oracle: A multithreaded Rayon-powered CPU renderer that computes IEEE-compliant, deterministic reference pixels.
  • The wgpu GPU compositor: A compute and fragment shader pipeline running on native GPU hardware for 120 FPS panning and zoom.

During continuous integration, oracle test suites execute both compositors against authentic Photoshop PSDs, flagging discrepancies down to individual color channels.

4. Built for AI Agents: The 500+ Command Registry

In PhotoCraft, the graphical user interface (egui) does not talk directly to document memory. Instead, every button, menu item, slider, and shortcut dispatches an entry from a central catalog of over 500 strongly-typed commands.

Because this command layer sits between the UI and document state, driving PhotoCraft via automated scripts or AI agents requires zero headless browser hacks:

# Headless batch processing via photocraft-cli
photocraft-cli run poster.psd \
  --cmd filter.sharpen.smartSharpen     --params '{"amount":85}' \
  --cmd layer.newAdjustmentLayer.curves --params '{"points":[[0,0],[64,48],[192,212],[255,255]]}' \
  --out poster-graded.png

To let an autonomous coding agent inspect and manipulate layered designs, launch the built-in MCP server:

# Expose the PhotoCraft engine as a Model Context Protocol service
photocraft-cli mcp

This command connects directly to Claude Code, Gemini CLI, Cursor, or Antigravity, letting agents inspect layer trees, toggle masks, crop frames, and export raster slices through JSON-RPC.


Part 3: Diagnosis (The Rough Edges & Parity Reality)

Open-source hype often clouds technical reality. The Storytold engineering team deserves immense credit for publishing an unvarnished parity scorecard rather than marketing fluff.

As of early October 2026, PhotoCraft stands in early alpha. While 626 out of 626 Photoshop menu items are wired up to dispatch commands, wiring a command does not equal complete runtime behavior.

Actual Parity Breakdown (October 2026 Audit):
- Menu Dispatch Wiring:      100% (626 / 626 wired)
- PSD Round-Trip Fidelity:    99%  (169 / 170 test corpus files pass)
- Feature Surface Coverage:   60% - 70% (basic operations live)
- Daily Pro Work Readiness:   25% - 35% (lacks deep professional toolchains)

The “Vibe-Coding” Controversy on X (Twitter)

Within hours of landing on GitHub and Hacker News, discussions erupted across tech feeds on X. The primary catalyst was a revelation shared by creators that the entire suite of seven Crafting Apps was bootstrapped in record time using Anthropic’s Claude Opus 5.5.

A developer says he used Opus 5.5 to recreate seven essential Adobe apps, including Photoshop, as free, open-source alternatives (no more subscriptions). Built in Rust, free to use, with public source code. These are early versions, PhotoCraft is not yet ready to replace daily Photoshop work.
Bản gốc tiếng Anh (English)
A developer says he used Opus 5.5 to recreate seven essential Adobe apps, including Photoshop, as free, open-source alternatives (no more subscriptions). Built in Rust, free to use, with public source code. These are early versions, PhotoCraft is not yet ready to replace Photoshop for daily professional work completely, bout about 90% they say. What a fantastic time to be alive. I love it.

Reactions were sharply divided between awe at AI-assisted engineering velocity and skepticism from seasoned toolmakers:

  1. The Optimists: Seeing seven native Rust creative tools appear overnight without telemetry or monthly subscriptions felt like an open-source triumph against Adobe’s corporate rent-seeking.
  2. The Pragmatists: Power users immediately tested realistic workflows and encountered the classic Ninety-Ninety Rule of software engineering (the first 90% of the code accounts for the first 90% of development time; the remaining 10% takes the other 90%). Japanese designer @fujix noted that PhotoCraft completely failed to accept Japanese text input, and canvas panning stuttered under complex layout PSDs.
X.com
Photoshop clones keep popping up. PhotoCraft: Made with Rust. Couldn't handle Japanese input. Apache license. PhotoSuite: Runs on Tauri WebView. Has the UI that feels most like the original. Features are limited.
Bản gốc tiếng Anh (English)
Photoshop クローンがどんどんでてくるだよ。 - PhotoCraft: Rust 製。日本語入力できなかった。Apache ライセンス。https://getartcraft.com/apps - PhotoSuite: たうりん WebView 動作。最も本家っぽい UI。機能は限定的。 https://github.com/eolix/photosuite - Photon Studio: 今のところ最も多機能。クローズド。 https://tenzen.studio/photon/

To the author’s credit, the repository openly admits that “vibe-coding” initial architecture creates shallow coverage: early alpha testers discovered 214 keyboard shortcut failures, offset text carets, and sticky crop handles that naive unit tests had missed. Wiring 626 menus with an LLM is fast; perfecting thirty years of human motor interaction requires patient, disciplined engineering.

The Major Gaps You Must Know:

  1. About 20 core tools remain missing: While standard Brushes, Clone Stamp, and Lassos work well, tools like the Curvature Pen, Magnetic Lasso, Direct Selection, Patch Tool, Content-Aware Move, and Perspective Crop are still under development.
  2. Text engine and internationalization: Beyond missing vertical type masks, basic CJK (Chinese, Japanese, Korean) IME input composition remains broken on desktop builds.
  3. Mathematical filter variance: Smart filters survive PSD saving and re-opening, but mathematical filters like Unsharp Mask and Gaussian Blur show subtle high-radius differences compared to proprietary Adobe filters.
  4. No legacy .8BF binary plugins: PhotoCraft rejects closed-source, platform-dependent DLL and .8BF plugin binaries for security reasons. It introduces an isolated, sandboxed WebAssembly plugin runtime instead.
  5. Deferred generative AI: The maintainers explicitly deferred generative AI wrappers to prioritize rock-solid raster math, text rendering, and tablet pen pressure.

Part 4: Resolution (Decision Matrix)

PhotoCraft is neither a dead project nor a complete commercial replacement yet. Here is how engineering teams should assess it today:

Evaluation Criteria Adopt / Test PhotoCraft Now Stick With Adobe / Alternatives
Headless Image Automation Need scriptable, multi-threaded PSD rendering in CI/CD without Adobe licensing fees. Workflows rely on proprietary Photoshop Actions (.atn) with complex ExtendScript hooks.
Autonomous AI Agents Connecting Claude or Gemini to inspect and tweak layered artwork via native MCP. Workflows require Firefly cloud generative inpainting inside canvas dialogs.
System Privacy & OpSec Air-gapped environments demanding zero telemetry, zero cloud logins, and pure open source. Enterprise teams tied to Adobe Creative Cloud Team libraries and Adobe Fonts sync.
Commercial Print Prep Basic CMYK export is acceptable; standard digital UI and web raster work. Complex spot colors, duotone setups, and certified prepress press proofing required.

Final Take

PhotoCraft proves that replacing thirty years of proprietary software bloat does not require compromises: with pure safe Rust, copy-on-write sparse memory grids, and a native MCP command bus, open source can build creative tools that respect both artist muscle memory and developer autonomy.


Student First Assignment

  1. Clone the repository: git clone https://github.com/storytold/photocraft && cd photocraft.
  2. Inspect the test suite: run cargo test -p photocraft-psd to verify how clean-room PSD parsing passes without unsafe blocks.
  3. Launch the headless CLI: execute cargo run --release -p photocraft-cli -- --help and experiment with applying a basic filter command against an existing PNG or PSD file.
  4. Verify that memory usage remains stable and no background telemetry processes are spawned on your host system.

Frequently Asked Questions (FAQ)

Does PhotoCraft require an internet connection or an account?

No. PhotoCraft is 100% offline and decentralized. It requires zero cloud authentication, installs no background update daemons, and contains zero tracking telemetry.

Can PhotoCraft open and save Adobe Photoshop (.psd) files without corrupting them?

Yes. PhotoCraft includes a dedicated photocraft-psd crate that passes 169 out of 170 test corpus files in round-trip tests. It preserves unknown proprietary metadata blocks on disk rather than stripping them.

How does PhotoCraft integrate with AI agents?

Every tool, adjustment, and filter is registered as an executable command in a unified catalog. Running photocraft-cli mcp boots a Model Context Protocol server, enabling LLM coding agents to inspect layers, manipulate masks, and export graphics via JSON-RPC.

Can I run PhotoCraft in the browser?

Yes. The entire engine compiles to WebAssembly (wasm32-unknown-unknown) using a dedicated wasm-release profile that strips debug symbols and optimizes binary size down to under 19 MB.

Related posts