Repository navigation
feat(tools): Add background tool - #1081
Merged
Merged
Conversation
A palette tool that sets pictures on a gradient, a colour or a picture of one's own, with padding, rounded corners, a soft shadow and a canvas shape (Auto, Square, 16:9, 4:5). The file is drawn with Skia, as the window's preview is, so what the window shows is what the file gets. Settings schema 64 adds the built-in tool-background to the palette (KnifeLemon#876). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
KnifeLemon
approved these changes
Nov 4, 2026
KnifeLemon
left a comment
Owner
There was a problem hiding this comment.
Thanks, @lightscape-jm! This follows #876 and the #856 plan closely:
- palette only, the same stage as Pixelate / blur and Annotate;
Backdropcounted inReworksPixels, no History retry;- the picture path left out of exports and imports;
- the tool inserted after
tool-annotatefor existing libraries too.
What I checked
- Build: on current
main;dotnet format --verify-no-changesis clean. - Tests: Core all pass (970), Engines
Backdrop/ImageEncoder(86), App Background, Localization and palette (334). CI is green everywhere. - Strings: all 40 keys are in all 20 language files, Vietnamese included.
- Real files: I ran it as a conversion on generated pictures with four looks: a screenshot, a greyscale picture, a CMYK JPEG without a profile, a transparent cut-out and a very thin strip (also a transparent GIF, an EXIF-rotated JPEG and a 16-bit grey PNG). Colours, shadow, rotation, canvas shapes and the cover crop of a picture behind all came out right, and a missing picture behind fails the file as it should.
Must fix
Nothing.
One thing to watch
#1064 (upscaling) also wants settings schema 64. This one lands first, so 64 is yours; we'll move the other one.
Merging now.
This was referenced Nov 4, 2026
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 does this change?
Closes #876. Adds Add background, a palette tool that sets pictures on a gradient, a colour or a picture of one's own, with padding, rounded corners, a soft shadow and a canvas shape, as planned in #856 (step 5, after Annotate). It is in the palette's Edit tab for pictures, not on a default donut.
What the window shows is what the file gets. This was the bar for the whole tool, so it is built and tested around it:
Engines/Magick/BackdropComposerdraws the file with Skia, with the same things the window draws with: Avalonia's linear gradient brush and drop shadow are Skia's. The layout and the shadow come from the same formulas on both sides.How it's built (also in
docs/ARCHITECTURE.md→ Add background tool):ImageOptions.Backdrop(BackdropOptions): kind, colours, picture, padding, corners, shadow and canvas. Enums are read leniently, numbers clamped, colours checked. It counts inReworksPixels, so it is applied once, in the first transform step; a route that can't apply it fails witherror.images_only; History offers no Retry, as for hidden parts and marks.ImageOptions.BackdropLook. An export or import leaves out the path of a picture of one's own.BackgroundViewModelandBackgroundWindowfollow Pixelate / blur and Annotate: the key handling (Enter saves unless a control reached with the keyboard takes it, Esc closes, arrows along a row of choices), radio buttons with names a screen reader says, a summary when a picture can't be opened or saved, a failed save that keeps the picture, the look kept however the window closes, texts that follow a language change, and a preview that isn't mirrored in a right-to-left UI.Compatibility: the built-in
tool-backgroundcomes with settings schema 64, after Annotate's 60 and the steps that landed since (UserDataStoreadds it to existing libraries after Annotate, in the palette only). I can renumber it if another change takes 64 first. An older Filee doesn't know the tool and opens nothing for it. SkiaSharp and Magick.NET are already dependencies, so nothing new is added.Type of change
How was it tested?
dotnet format --verify-no-changesdotnet test: Core, Cli and Platform pass, and all the Add background tests in App, Core and Engines pass on macOS, in an Ubuntu 24.04 container and on Windows 11 ARM64. On my Mac, the Engines and App tests that fail on unmodifiedmainfail the same way (FFmpeg without some encoders, the engine-page renders,A_second_engine_can_be_installed…, and the flakyA_lost_animation_frame…). I didn't run the Windows installer (Setup) tests.main, light and dark): put on the Images donut from the palette's Edit tab; three screenshots opened from the donut; each background (gradient presets, colour swatches, a photo of my own behind), each canvas shape (the size shown under the preview was the file's each time), Save & next over the three, then the files checked (sizes as shown, opaque). The look was kept on disk when the window closed, and a photo behind kept in the look was read again when the tool next opened.New tests:
BackdropTests(77)BackgroundToolTests(14)BackgroundWindowTests(62)Screenshots (UI changes)
The window, dark, three pictures on one look:
The window, light, one picture:
A saved file ("screenshot-3 With Background.png", 1340 × 1080):
Checklist
src/Filee.App/Assets/i18n/*.jsonfiles (40 strings, translated in every language)THIRD-PARTY-NOTICES.md(none: SkiaSharp and Magick.NET are listed already)🤖 Generated with Claude Code