Skip to content

BUG-REMOVE-BACKGROUND-MASK-NOT-TARGETED #19673

Done

Description

@davidmann4

TL;DR: after Remove Background, the new layer mask should be the edit target, as after Add Layer Mask, not the layer's pixels.

What happens today (main 44f38f0)

  • Test document: 800x600 RGB/8 with an opaque pixel layer "Photo" (white with a red 300x200 rectangle at 100,100).
  • After layer.removeBackground on "Photo" the mask is added, but the pixels stay targeted: document.inspect reports channels.target {kind:"composite"}, the tab title reads (Photo, RGB/8) and the pixel thumbnail is framed.
  • The command never changes the channel target: run in crates/engine-core/src/cmd/cutout_cmds.rs:50-89 sets the mask and clears the selection only.

Reference application (measured)

  • After Remove background the mask thumbnail of the layer is selected and the title bar reads (Pixels, Layer Mask/8), so the next brush stroke edits the mask.

Not measured: what happens to the foreground/background colours when the target moves to the mask; they follow today's mask-target behaviour (the same as ui.set {maskTarget}).

Done when

  • After Remove Background (Properties quick action or layer.removeBackground) the layer's mask is the target: channels.target names the layer mask, the mask thumbnail is framed, the title shows Layer Mask.
  • Undo returns to the earlier target.
  • A refused run (no subject, locked layer) leaves the target as it was.

Where

  • crates/engine-core/src/cmd/cutout_cmds.rs
  • New test file: crates/engine-core/src/cmd/remove_background_mask_target_tests.rs

Related

Rules for this item

  • Part of EPIC-TASK-BAR #16748 (EPIC-TASK-BAR). Comment here when you take it and open a draft PR early that says Fixes #<this issue>.
  • Put your tests in the new test file named above, and touch only the files under "Where".
  • Cases marked not measured keep today's behaviour. Ask here instead of guessing.
  • Don't edit docs/ui-parity.md or other parity docs. The epic updates them once for all items.

Activity

  1. added
    bug
    on Dec 3, 2026
  2. qvest-ssels commented on Dec 3, 2026

    @qvest-ssels
    Contributor

    👀 Looking into this, and I may open a PR for it.

  3. added a commit that references this issue on Dec 3, 2026
  4. added a commit that references this issue on Dec 3, 2026
    267c8e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions