An open-source, clean-room reimplementation of Adobe Photoshop in pure Rust

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

PhotoCraft Image editing; an open-source, clean-room reimplementation of Adobe Photoshop, rebuilt in pure Rust. Layers, masks, adjustment layers, layer styles, type, vectors, brushes and real PSD files, in a native app written entirely in Rust. Open source, offline, and yours.

PhotoCraft 图像编辑;这是一个开源的、从零开始用纯 Rust 重写的 Adobe Photoshop 实现。它在完全用 Rust 编写的原生应用程序中提供了图层、蒙版、调整图层、图层样式、文字、矢量、画笔和真实的 PSD 文件支持。开源、离线,且完全属于你。

PhotoCraft on getartcraft.com · ArtCraft · All Crafting Apps A caption card with a drop shadow, live type, and Vibrance and Curves adjustment layers, with the Curves editor open. The Great Wave off Kanagawa, Katsushika Hokusai, c. 1831 NoteArtCraft is a community of artists from all walks of life. Digital, generative, music, games — if you make things, you’re one of us. Come say hi on Discord.

PhotoCraft 位于 getartcraft.com · ArtCraft · 所有 Crafting 应用。一张带有投影、实时文字以及“自然饱和度”和“曲线”调整图层的说明卡片,曲线编辑器处于打开状态。《神奈川冲浪里》,葛饰北斋,约 1831 年。注:ArtCraft 是一个由各行各业艺术家组成的社区。数字艺术、生成艺术、音乐、游戏——如果你是创作者,你就是我们的一员。欢迎来 Discord 打个招呼。

Features · Everything in the box · PSD · Agents · Under the hood · Get started · Crafting Apps · Discord 🎛️ Familiar by design The menus, shortcuts, panels and tools are where your hands expect them, from ⌘J to ⇧⌘D. If you know Photoshop, you already know PhotoCraft.

功能 · 开箱即用 · PSD · 代理 · 技术内幕 · 入门指南 · Crafting 应用 · Discord 🎛️ 设计上保持熟悉。菜单、快捷键、面板和工具都在你习惯的位置,从 ⌘J 到 ⇧⌘D。如果你熟悉 Photoshop,那你也就熟悉 PhotoCraft。

⚡ Native and fast A GPU compositor on wgpu (Metal, Vulkan, DX12, WebGPU), copy-on-write tiles and multithreaded filters. No Electron, no web view, no waiting.

⚡ 原生且快速。基于 wgpu(Metal、Vulkan、DX12、WebGPU)的 GPU 合成器,采用写时复制(copy-on-write)切片和多线程滤镜。没有 Electron,没有 Web 视图,无需等待。

🗂️ Real PSD files Open, edit and save layered Photoshop documents. Re-saving keeps the render of 307 of the 309 psd-tools test files.

🗂️ 真实的 PSD 文件。打开、编辑并保存分层的 Photoshop 文档。重新保存后,在 309 个 psd-tools 测试文件中,有 307 个能保持渲染一致。

🤖 Agent-ready Every action is a command, so you can drive the same engine from the UI, the CLI, a JSON control channel or an MCP server.

🤖 代理就绪。每一个动作都是一条命令,因此你可以通过 UI、CLI、JSON 控制通道或 MCP 服务器来驱动同一个引擎。

Features Every screenshot here is the real app at work on public-domain art, rendered offscreen through its control channel. Levels and Vibrance adjustment layers, with the live Histogram panel.Impression, Sunrise, Claude Monet, 1872

功能。这里的每一张截图都是该应用程序在处理公有领域艺术品时的真实工作状态,通过其控制通道进行离屏渲染。包含“色阶”和“自然饱和度”调整图层,以及实时直方图面板。《印象·日出》,克劳德·莫奈,1872 年。

Edit without regret Adjustment layers keep every edit live. Stack Levels, Curves, Vibrance, Hue/Saturation and a dozen more, mask them to an area, reorder them, or turn them off, and your original pixels never change.

无悔编辑。调整图层让每一次编辑都保持实时状态。堆叠“色阶”、“曲线”、“自然饱和度”、“色相/饱和度”等十几种调整,将它们蒙版到特定区域,重新排序或关闭它们,你的原始像素永远不会改变。

16 adjustment layers that also apply directly to pixels, including Curves with per-channel editing, Levels with a live histogram, Black & White, Channel Mixer, Gradient Map, Photo Filter, Selective Color and Color Lookup (.cube, .3dl, .look). Plus Shadows/Highlights, Replace Color, Match Color, HDR Toning, Desaturate and Equalize.

16 种也可直接应用于像素的调整图层,包括支持通道编辑的“曲线”、带有实时直方图的“色阶”、“黑白”、“通道混合器”、“渐变映射”、“照片滤镜”、“可选颜色”和“颜色查找”(.cube, .3dl, .look)。此外还有“阴影/高光”、“替换颜色”、“匹配颜色”、“HDR 色调”、“去色”和“等值”。

Outer Glow and Stroke on a live type layer, in the Layer Style dialog.Earthrise, William Anders / NASA, 1968

在图层样式对话框中,对实时文字图层应用“外发光”和“描边”。《地出》,威廉·安德斯 / NASA,1968 年。

Styles that sell the shot Drop Shadow, Inner Shadow, Outer and Inner Glow, Bevel & Emboss, Satin, Stroke, and Color, Gradient and Pattern Overlay, live on any layer, including type. Patterns come from a library (built-ins, Edit › Define Pattern, .pat import/export) and PSD Patt blocks. Copy and paste styles between layers, hide all effects at once, and open styles straight from your PSDs, rendered to match Photoshop.

让画面出彩的样式。投影、内阴影、外发光与内发光、斜面和浮雕、光泽、描边,以及颜色、渐变和图案叠加,可实时应用于任何图层,包括文字。图案来自库(内置、编辑 › 定义图案、.pat 导入/导出)和 PSD Patt 块。可以在图层间复制粘贴样式,一次性隐藏所有效果,并直接从 PSD 中打开样式,渲染效果与 Photoshop 一致。

An elliptical selection becomes the mask of a Hue/Saturation layer, so only the face keeps its color.Girl with a Pearl Earring, Johannes Vermeer, c. 1665

椭圆选区成为“色相/饱和度”图层的蒙版,因此只有脸部保留了颜色。《戴珍珠耳环的少女》,约翰内斯·维米尔,约 1665 年。

Selections that understand your image Marquees, lassos and the Magic Wand for precision; Quick Selection, Object Selection and Select Subject when you want the computer to do the tracing; Select and Mask to refine hair-fine edges. Feather, expand, contract, smooth, grow, reselect. Turn any selection into a layer mask, a vector path or a shape. Smart selection runs on your machine, with no cloud and no account.

理解你图像的选区工具。用于精确选择的选框、套索和魔棒;当你希望计算机自动追踪时,可使用快速选择、对象选择和选择主体;使用“选择并遮住”来精细化处理发丝边缘。支持羽化、扩展、收缩、平滑、增长、重新选择。将任何选区转换为图层蒙版、矢量路径或形状。智能选择在你的机器上运行,无需云端,无需账户。

A headline edited in place, with a byline and a paragraph of body text.Among the Sierra Nevada, California, Albert Bierstadt, 1868

原地编辑的标题,配有署名和一段正文。《加利福尼亚内华达山脉》,阿尔伯特·比尔施塔特,1868 年。

Type that sets beautifully Point and paragraph text, edited right on the canvas, with full Character and Paragraph controls: font, weight, size, leading, tracking, alignment and colour. Type layers stay editable, take layer styles, and round-trip through PSD.

排版精美的文字。点文字和段落文字,直接在画布上编辑,具备完整的字符和段落控制:字体、字重、大小、行距、字间距、对齐方式和颜色。文字图层保持可编辑状态,支持图层样式,并可通过 PSD 进行往返编辑。

A badge made of shape layers: a gradient-filled lotus, a star and a dotted ring.Water Lilies, Claude Monet, 1906

由形状图层组成的徽章:填充渐变的莲花、星星和虚线圆环。《睡莲》,克劳德·莫奈,1906 年。

Pixel-perfect vectors Rectangle, Ellipse, Triangle, Polygon, Line and the Pen tool, with resolution-independent shape layers, gradient fills, and dashed, aligned strokes. Combine shapes (unite, subtract, intersect, exclude), keep paths in the Paths panel, use them as vector masks, or stroke and fill them. 116 of 116 shape layers in our PSD corpus match Photoshop’s pixels.

像素级完美的矢量。矩形、椭圆、三角形、多边形、直线和钢笔工具,支持与分辨率无关的形状图层、渐变填充以及虚线和对齐描边。组合形状(合并、减去、相交、排除),在路径面板中保留路径,将它们用作矢量蒙版,或进行描边和填充。我们 PSD 语料库中的 116 个形状图层全部与 Photoshop 的像素匹配。

Twirl previews live on the canvas, only inside the selection.The Starry Night, Vincent van Gogh, 1889

“旋转扭曲”在画布上实时预览,仅限于选区内。《星月夜》,文森特·梵高,1889 年。

See it before you commit Every filter dialog previews live on the canvas, through your selection. Blurs (Gaussian, Box, Motion, Radial, Surface, Smart, Lens, Shape, and the Blur Gallery: Tilt-Shift, Iris, Field, Spin, Path), sharpening, Reduce Noise, distortions (Twirl, Wave, Ripple, Displace, Shear, Zig Zag…), Pixelate, Stylize (Oil Paint, Wind, Extrude…), Render (Clouds, Fibers, Lens Flare, Lighting Effects) and more. Run filters on a smart object and they stay editable: change, hide, reorder or mask them at any time. Large-radius blurs use running-sum box passes across all cores: a radius-180 Gaussian on 3.6 MP takes under a second.

确认前先预览。每个滤镜对话框都会通过你的选区在画布上实时预览。包括模糊(高斯、方框、动感、径向、表面、智能、镜头、形状,以及模糊画廊:移轴、光圈、场、旋转、路径)、锐化、减少杂色、扭曲(旋转扭曲、波浪、波纹、置换、切变、之字形……)、像素化、风格化(油画、风、挤压……)、渲染(云彩、纤维、镜头光晕、光照效果)等。在智能对象上运行滤镜,它们将保持可编辑状态:随时更改、隐藏、重新排序或遮盖它们。大半径模糊使用跨所有核心的运行和方框传递:在 360 万像素上进行半径 180 的高斯模糊耗时不到一秒。

Free Transform on a rotated print, with every step listed in History.The Tetons and the Snake River, Ansel Adams, 1942

对旋转后的印刷品进行自由变换,每一步都在历史记录中列出。《提顿山脉与蛇河》,安塞尔·亚当斯,1942 年。

Shape it any way you like Free Transform with scale, rotate, skew, distort and perspective; exact 90° and 180° rotations and flips; Transform Again. Layers, type, shapes, masks and selections all transform together. Full history, Toggle Last State and the History Brush mean every step can be undone, even one brush stroke at a time.

随心所欲地塑形。自由变换支持缩放、旋转、倾斜、扭曲和透视;精确的 90° 和 180° 旋转及翻转;再次变换。图层、文字、形状、蒙版和选区均可一起变换。完整的历史记录、切换最后状态和历史记录画笔意味着每一步都可以撤销,甚至可以一次撤销一个画笔笔触。

Export As in the light theme, with a preview and a file-size estimate.The Kiss, Gustav Klimt, 1907–1908

浅色主题下的“导出为”,带有预览和文件大小估算。《吻》,古斯塔夫·克里姆特,1907–1908 年。

Ship it anywhere Export As with format, quality, transparency and scale, plus a preview and an instant file-size estimate. Quick Export to PNG in one click. Choose a dark Pro theme, the airy Studio themes, or a Classic look.

随处发布。“导出为”支持格式、质量、透明度和缩放,并提供预览和即时文件大小估算。一键快速导出为 PNG。选择深色专业主题、轻盈的 Studio 主题或经典外观。

Everything in the box 🧰 34 tools Move · Rectangular and Elliptical Marquee · Lasso · Polygonal Lasso · Magnetic Lasso · Magic Wand · Quick Selection · Object Selection · Crop · Eyedropper · Brush · Pencil · Mixer Brush · Color Replacement · Eraser · Clone Stamp · Healing Brush · Spot Healing · History Brush · Gradient · Paint Bucket

开箱即用 🧰 34 种工具:移动 · 矩形和椭圆选框 · 套索 · 多边形套索 · 磁性套索 · 魔棒 · 快速选择 · 对象选择 · 裁剪 · 吸管 · 画笔 · 铅笔 · 混合器画笔 · 颜色替换 · 橡皮擦 · 仿制图章 · 修复画笔 · 污点修复 · 历史记录画笔 · 渐变 · 油漆桶