Repository navigation
Add a one-stroke Remove tool - #206
Merged
Merged
Conversation
BackgroundEdit splits an edit into prepare (UI thread), run (worker, with JobControl progress, cancellation and a missing-model notice) and apply (one history entry). Hosts that do not enable background edits get them run inline. Adds Overlay::Stroke for translucent painted strokes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dings The stroke becomes a grown, feathered mask; a context window sized to the inpainting network's training slides inside the canvas; thin holes use spot healing's ring interpolation (threshold measured by the new remove_eval example) and the rest Content-Aware Fill's network + patch synthesis + seam pipeline, now cancellable and reporting progress. Sample All Layers, per-stroke or accumulated removal, selection confinement and one undo step per removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Queued tool edits run one at a time on the background executor; the status bar shows progress with Cancel (Escape also cancels) and offers Manage Models after a fill that had no network. Results whose document changed are re-prepared. Options bar gets Size and Apply for the Remove tool, the canvas draws pending strokes, and the tool gets its icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IAmJSD
force-pushed
the
feat/remove-tool
branch
from
October 4, 2026 10:36
6879598 to
a620e4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
This adds a Photoshop-style Remove tool to the healing group (
J, Shift+Jcycles to it; also in Spotlight). You paint over an unwanted object in one stroke and it is filled in when you release. Brush size is pressure-sensitive and works with[/]. Inference runs off the UI thread with a progress bar and Cancel, so painting is never blocked. The tool reuses the existing inpainting network and Content-Aware Fill pipeline; no new models are added.Design
Plugin API (
crates/plugin-api/src/background.rs). AddsBackgroundEdit, which has three stages:prepare(&Document)runs on the UI thread and can be re-called.run(&JobControl)runs on a worker.JobControlcarries progress, cancellation and a missing-model notice.apply(&mut Document)runs on the UI thread as one history entry.Tools get
set_background_edits/take_background_edit. Hosts that never enable these (tests, MCP, the browser) run the edit inline. Also addsOverlay::Strokefor the translucent pink stroke.Tool (
plugins/tools-retouch/src/remove.rs).SPOT_HEAL_MAX_THICKNESS= 5.5 px thick use spot healing's ring interpolation, generalised to any hole shape. Thicker holes use the inpainting network, then patch synthesis, then seam relaxation.examples/remove_eval.rs: 192 stroke holes across 8 Kodak images, scored on error and texture ratio. The table is in the doc comment. Below about 5.5 px, patch synthesis adds more edges than the photo had (texture ratio 1.2–1.7) and about 10% more error. Above it, the fill's texture ratio is about 1, while interpolation smears (about 0.25).fill.rsgainsinpaint_windowwith cancellation and progress.inpaint()behaves as before.schist_neuralalready does; the backend is selected automatically, with CPU fallback.halo.rsis Anti-Smudge's glow cleanup and doesn't apply to inpainting. The seam handling used is Content-Aware Fill's own seam relaxation plus the feathered blend.Editor (
crates/editor/src/workspace/tool_jobs.rs).icons/remove.svg, drawn in the line style of the other healing icons.i18n: 9 new keys, translated in all 147 catalogs (split across 10 subagents);
no/shregenerated.Before/after (eyeball these)
These are on the dev box under
~/remove-tool-demo/, not attached here.k19-side.png(kodim19): the coin binocular viewer is removed. The fence and plinth behind it come back patchy and blurred, and the small DANGER sign inside the brush went with it.k20-side.png(kodim20): a background plane at the image edge is removed. The fill is blocky where the hangar and tree line were.k13-side.png(kodim13): a synthetic 1 px wire, removed with a 3 px brush (spot path). Clean over sky; over rock it leaves a visible smooth band.kodim{13-wire,19,20}-{before,after}.png.Verification done
cargo test -p schist-tools-retouch -p schist-plugin-api: all pass. New tests cover:compositor-gpu/tests/compute_programs.rsand passes on lavapipe.cargo test -p schist-mcppasses.cargo clippy -D warningsis clean on schist-tools-retouch, schist-plugin-api (all targets) and schist-editor.cargo fmtwas run.make check-i18npasses. The web-font coverage check initially caught Tibetan《》; they are replaced.Not verified
BrushDynamics::pressure_size.make check-neural-gpuwasn't run; only the targeted parity test was.Limits
crates/neural; it uses onlyschist_neural::{get, installed, inpaint, Model}, which Add local background removal and accelerate Anti-Smudge inference #190 keeps. The cancel and status pattern mirrors Add local background removal and accelerate Anti-Smudge inference #190's background removal.🤖 Generated with Claude Code