PhotoCraft 如何移除背景而不刪除任何像素
Remove a Background in PhotoCraft Without Deleting a Single Pixel
PhotoCraft 0.8.2 的「Remove Background」會辨識所選圖層的主體並加入圖層遮罩,隱藏背景而不刪除原有像素。功能在本機執行,遮罩可手動修整或復原。完成後可匯出帶透明度的 PNG,並以 .pcraft 保留可編輯的遮罩。
PhotoCraft is the free, open-source image editor from the ArtCraft team that copies Photoshop's layout: layers, masks, adjustment layers and PSD support, written in Rust. One of the first things people try in it is a background removal. It works well, but two things trip up new users: the button doesn't show up at all on some layers, and the result isn't really an "erase" step.
This walkthrough covers the whole job, from opening the photo to exporting a PNG with transparency. It was written against PhotoCraft 0.8.2, where the command moved from the Layer menu to the Properties panel. Newer releases may move it again, so check the release notes if your menus look different.
Disclosure: I maintain an unofficial guide site for PhotoCraft. I'm not part of the PhotoCraft or ArtCraft team.
What "Remove Background" actually does
It doesn't delete anything. PhotoCraft finds the subject, refines the edge, and adds one layer mask to the layer. The subject stays visible, the rest is hidden, and every original pixel is still on the layer.
That matters because:
- you can paint the mask afterwards to fix an edge,
- Undo takes the mask off and Redo puts it back (the history step is called Remove Background),
- clicking the button a second time replaces the mask instead of stacking a second one.
It also runs on your machine. It uses the same on-device subject detection as Select Subject: no account, no upload, no cloud step.
Step 0: Open the photo (and work on a copy)
Use File › Open, the recent-files list, or drop the file on the window. JPEG, PNG, PSD/PSB and several camera raw formats (DNG, CR2, NEF, ARW, RAF) open. CR3 isn't on the list yet.
PhotoCraft is still early alpha, and its developers say so. If the source is an important PSD, open a copy, not the original.
Step 1: Unlock the layer (this is why the button is "missing")
In 0.8.2 the Quick Actions section of the Properties panel stays empty on a locked layer. A freshly opened photo is usually a locked Background layer, and a Background layer can't hold a mask at all.
- Background layer: double-click it in the Layers panel, or choose Layer › New › Layer from Background. PhotoCraft renames it Layer 0 and clears the locks.
- Normal pixel layer: in the Lock row, turn off Lock all and Lock image pixels.
Type, shape, smart object, group, fill and adjustment layers never show these buttons. Rasterize or pick a pixel layer first.
Step 2: Click Remove Background
Open Window › Properties and scroll to Quick Actions. You'll see two buttons: Select Subject and Remove Background. Click Remove Background.
The command only looks at the selected layer. It doesn't sample the layers underneath. If you have an empty layer selected above your photo, nothing happens. The same goes for a layer with no clear subject: the document stays unchanged.
Any active selection is cleared when the mask is added.
Step 3: Check and fix the edge
A checkerboard now shows where the background is hidden, and a white thumbnail next to the layer is the mask.
Zoom to 100% and look at hair, fur and other fine edges. That's where automatic cut-outs fail, in PhotoCraft and everywhere else. The project's own roadmap still calls the cut-out workflow partial, and Select and Mask is a simpler dialog than Photoshop's full workspace.
To fix an edge, click the mask thumbnail so you're painting on the mask, then:
- paint black to hide more,
- paint white to bring pixels back,
- use grey for partial transparency (soft hair edges).
For a small, even correction, the selection commands (feather, expand, contract, smooth) are quicker than painting.
Step 4 (optional): Mask an adjustment instead of the photo
The same mask idea works for color changes without touching the photo. Make a selection (for example Select Subject), add an adjustment layer such as Hue/Saturation, and the selection becomes that adjustment's mask. Only the masked area changes, and the photo's pixels stay as they were. Want the subject in color and the background in black and white? Invert the selection and desaturate.
Step 5: Export a transparent PNG and keep an editable copy
The file you hand to someone and the file you keep for editing aren't the same:
| You want… | Use |
|---|---|
| To keep editing in PhotoCraft later | Save As › .pcraft. It's PhotoCraft's lossless native format, with incremental save and crash recovery |
| Someone else to open the layers in another app | PSD (fidelity is still improving, so test it in the app that has to open it) |
| A finished cut-out with transparency | Export As › PNG, which shows a preview and a file-size estimate. Quick Export writes a PNG in one step |
Export flattens what you see, so the hidden background becomes real transparency in the PNG while your .pcraft keeps the mask editable.
Quick troubleshooting
- No Remove Background button: the layer is locked, or it's a Background, type, shape, group or adjustment layer. Unlock it or pick the pixel layer.
- Nothing happened: the selected layer has no subject, or you selected an empty layer above the photo.
- "Where did Layer › Remove Background go?" The v0.5.0 notes put it in the Layer menu. In 0.8.2 it's only the Quick Actions button.
- Bad hair edge: paint the mask in grey/white at 100% zoom, or feather the selection before running it again.
Getting PhotoCraft
Download it only from the official sources: the GitHub releases or the PhotoCraft page on getartcraft.com. Builds exist for Windows, macOS, Linux, FreeBSD and the web.
I keep a longer, version-checked version of this lesson, plus layers, masks and adjustment-layer lessons, in the PhotoCraft Guide editing lessons, along with install steps for each OS. If something in this post stops matching your version, check there first.
來源:DEV Community · dev.to