Skip to content

refactor(imaging): replace ImageSharp with SkiaSharp in Core/Imaging - #191

Merged
0Keith merged 3 commits into
mainfrom
refactor/181-skiasharp-imaging
Sep 27, 2026
Merged

0Keith merged 3 commits into
mainfrom
refactor/181-skiasharp-imaging

Conversation

@0Keith

@0Keith 0Keith commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

Closes #181

Replaces SixLabors.ImageSharp and ImageSharp.Drawing with SkiaSharp. ImageSharp 4.x fails the build without a Six Labors license key.

  • New imaging layer (Core/Imaging/): all image decoding, encoding, resizing and drawing lives here: resize-to-fit, gallery thumbnails, icon scaling, the tray menu icons, wallpaper annotation, PNG encoding with the JPEG fallback, and font lookup. No other app file references SkiaSharp. CLAUDE.md records the rule.
  • Packages: SkiaSharp 3.119.4, the version Avalonia 12.1.1 already renders with. SkiaSharp.HarfBuzz 3.119.2 shapes the annotation text so the font's kerning applies. It is the only release that resolves HarfBuzzSharp 8.3.1.3, the native library Avalonia ships, so Dependabot now ignores it until Avalonia moves.
  • Behaviour kept: the outline is a stroke pass then a fill pass, width fontSize/12 with a 1px floor. Annotation positions are unchanged. Output is 8-bit RGB PNG, with a JPEG fallback over 16 MB stepping quality down from 97. The downloader re-encodes JPEGs at quality 95. Gallery thumbnails are 600px wide. The font picker lists the fonts installed on the machine.
  • Known differences: images with transparency are composited onto black before encoding. Downscaling uses mipmap averaging rather than bicubic filtering.
  • Docs: CLAUDE.md, the README and the website's technology list now name SkiaSharp. Merging this deploys the website.
  • Dependabot: removes the temporary ImageSharp ignore rule added in chore(deps): stop Dependabot proposing ImageSharp major versions #183.

Verification

  • Release build has 0 errors and the same 5 warnings as main. 241 tests pass, 28 of them new.
  • The linux-x64 and win-x64 single-file publishes both succeed.
  • On the GNOME desktop: the annotated current.png is 3840×2160 8-bit RGB, with the title in Cinzel at the top left, and the desktop applied it. The launcher icon and the four tray menu icons draw correctly.
  • An offscreen render at 72pt shows kerning applied.
  • Not verified: how the app runs on Windows, since there is no Windows machine, and the tray menu as GNOME displays it, since the tray extension is disabled on the test desktop.

🤖 Generated with Claude Code

0Keith and others added 3 commits September 26, 2026 23:19
…e/Imaging

ImageSharp 4.x requires a paid Six Labors license, so the imaging stack moves
to SkiaSharp 3.119.4, which Avalonia 12.1.1 already ships. All SkiaSharp code
lives in Core/Imaging; no other app file references it.

- ImageCodec: decode, mipmapped resize, 8-bit RGB PNG and JPEG encode
- ImageResizing: resolution cap, 600px thumbnails, square icon resize
- WallpaperAnnotator: outlined title (stroke pass then fill pass,
  fontSize/12 with a 1px floor) and debug timestamp, same positions
- WallpaperRenderer: PNG first, JPEG fallback from quality 97 over 16 MB,
  with the size ceiling injectable for tests
- MenuIcons: the four 16px tray menu icons
- BundledFonts: embedded Cinzel plus installed families via Skia's font manager

Removes SixLabors.ImageSharp and ImageSharp.Drawing from both projects and the
Dependabot ignore rule that held ImageSharp at 3.x. Adds imaging-layer tests.

Refs #181

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md gains the Core/Imaging rule and folder, and the dependency list,
wallpaper processing and tray icon notes now name SkiaSharp. README and the
website tech list drop ImageSharp.

Refs #181

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Skia's plain DrawText ignores the font's kerning table, so pairs such as
"AV" and "TA" in wallpaper titles sat visibly apart after the move off
ImageSharp. WallpaperAnnotator now draws the title and timestamp through
SKShaper, keeping the stroke-then-fill passes, the ascent-based top edge,
and right alignment measured from the shaped width.

SkiaSharp.HarfBuzz is pinned at 3.119.2: it is the only release that
resolves HarfBuzzSharp 8.3.1.3, the native library Avalonia 12.1.1 ships
(3.119.4 needs 8.3.1.5). Dependabot ignores it until Avalonia moves.
CLAUDE.md dependencies now list it and correct Hosting to 10.0.11.

Refs #181

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0Keith
0Keith enabled auto-merge (squash) September 27, 2026 05:14
@0Keith
0Keith merged commit 9b21b61 into main Sep 27, 2026
4 checks passed
@0Keith
0Keith deleted the refactor/181-skiasharp-imaging branch September 27, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace SixLabors.ImageSharp: 4.x requires a commercial license

1 participant