Files
AnyImage/docs/remove-background.md
nan 1613bd3194 Add image perspective editing and related tools
- Implemented the Image Perspective tool for editing image corners in Blender.
- Created a new operator `EditImagePerspective` to handle the perspective transformation.
- Added a preview feature for the perspective adjustment.
- Introduced the `ImagePolylineTool` for editing image masks with polylines.
- Developed backend support for Real-ESRGAN model inference, including ONNX integration.
- Added functionality for image masking and background removal.
- Created unit tests for the Real-ESRGAN ONNX model to ensure correct preprocessing and inference.
2026-08-22 22:17:10 +08:00

1.9 KiB
Raw Blame History

去除背景

Remove Background 使用 BEN2 为 Image Empty 生成透明前景,不创建网格。它适合在转换前检查抠图效果,或继续把结果当作普通 Image Empty 使用。

使用方法

  1. 选中 Image Empty。
  2. 在 3D View 中右键,选择 AnyImage > Remove Background。
  3. 等待状态栏提示任务完成。

AnyImage 会创建新的透明颜色图,并把当前 Empty 切换到新图。对象的 Transform、显示尺寸、Offset 和其他显示设置保持不变。

在转换时去除背景

Depth Plane 和 Surface 的转换对话框也提供 Remove Background:

  • Depth Plane 会使用透明 Alpha 区分前景和背景深度。
  • Surface 会在写出网格前删除背景三角面。
  • 深度估算仍使用未经抠图的原始 RGB,避免透明区域提前影响模型判断。

图片、视频和序列帧

普通图片会得到一张透明 PNG。视频或序列帧会得到透明图片序列,并从源 Empty 的 Start 位置开始播放。处理范围跟随 Image Frames 和 Offset。

!!! note 动画结果引用 Storage Root 中任务目录里的序列帧。不要在仍使用这些素材时删除对应的 Job 文件夹。

常见问题

Remove Background 是灰色的

确认 Environment 已安装,且 MoGe-2 ViT-S Normal 与 BEN2 Base 都显示 Ready。正式功能会等默认必需模型全部就绪后启用。

透明边缘需要调整

当前正式入口不提供 BEN2 refinement 参数。可以在结果材质中继续处理 Alpha,或在外部图像软件中修整生成的颜色图。

所有 BEN2 任务都会先用输入 Alpha 遮住推理输入中的透明 RGB。正式输出只采用 BEN2 的 Alpha,颜色继续使用源 RGB;已有 Alpha 时,结果 Alpha 为“输入 Alpha × BEN2 Alpha”。因此 Image Box / Lasso 或外部工具创建的透明范围不会被去背景重新扩张,软边缘也会继续保留,同时避免透明黑参与 Viewport 纹理过滤。