Skip to content

Replace SkiaSharp with SixLabors.ImageSharp#80

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/remove-skia-sharp-dependency
Draft

Replace SkiaSharp with SixLabors.ImageSharp#80
Copilot wants to merge 1 commit into
mainfrom
copilot/remove-skia-sharp-dependency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

SkiaSharp pulls in ~370 MB of native runtime dependencies. ImageSharp is pure managed C# (~2-3 MB).

Changes

  • Dependencies: Remove SkiaSharp, SkiaSharp.NativeAssets.Linux, FFMpegCore.Extensions.SkiaSharp; add SixLabors.ImageSharp 3.1.12
  • PdqHasher.cs: Replace SKCodec/SKBitmap decode+resize pipeline with Image.Load<Rgba32> + Mutate(x => x.Resize(...)). Pixel access via Image<Rgba32> indexer instead of SKBitmap.GetPixel()
  • FFMegExtensions.cs: Replace SKBitmap.Decode(file) with Image.Load<Rgba32>(file)
  • Tests: Remove SkiaSharp.NativeAssets.Linux from test project — no longer needed

Breaking API changes

// Before
public HashResult FromBitmap(SKBitmap resized, string source)

// After
public HashResult FromImage(Image<Rgba32> resized, string source)

FFMegImageExt.GetSnapshotsFromUri() return type changes from SKBitmap to Image<Rgba32>.

All existing compliance tests pass with identical hash outputs — the switch is lossless for hash computation.

…e dependencies

Agent-Logs-Url: https://github.com/crispthinking/PdqHash/sessions/52ef266a-7d39-4eb8-abee-68dd3a03c6d4

Co-authored-by: corpo-iwillspeak <265613520+corpo-iwillspeak@users.noreply.github.com>
@corpo-iwillspeak
Copy link
Copy Markdown
Contributor

We'd need a good overview of the performance impact of this before merging. I'm tempted to not merge TBH.

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.

2 participants