From 7bc93c2014dfbaa5f8b8294abf065f3100de4162 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Wed, 12 Aug 2026 16:25:23 +0800 Subject: [PATCH] Anti-alias downscaled screenshots in the result window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full-res retina captures are downscaled to fit the window; nearest-neighbor made them look chunky. Use high-quality interpolation when shrinking, keep pixel-crisp rendering only when upscaling small selections. 💘 Generated with Crush Assisted-by: Crush:deepseek-v4-flash-0731 --- Sources/Kapture/ResultWindow.swift | 16 ++++++++++------ build-app.sh | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Sources/Kapture/ResultWindow.swift b/Sources/Kapture/ResultWindow.swift index 70f3998..64368a1 100644 --- a/Sources/Kapture/ResultWindow.swift +++ b/Sources/Kapture/ResultWindow.swift @@ -193,12 +193,16 @@ struct ResultView: View { .padding(.top, 10) if model.mode == .screenshot { - Image(nsImage: NSImage(cgImage: model.image, size: .zero)) - .resizable() - .interpolation(.none) - .aspectRatio(contentMode: .fit) - .border(Color.secondary.opacity(0.4)) - .padding(.horizontal, 12) + GeometryReader { geo in + let imageWidth = CGFloat(model.image.width) + Image(nsImage: NSImage(cgImage: model.image, size: .zero)) + .resizable() + // Downscale with smoothing (AA); upscale keeps pixels crisp. + .interpolation(imageWidth >= geo.size.width ? .high : .none) + .aspectRatio(contentMode: .fit) + } + .border(Color.secondary.opacity(0.4)) + .padding(.horizontal, 12) } else { ZStack(alignment: .bottomTrailing) { ScrollView { diff --git a/build-app.sh b/build-app.sh index 879951f..8bff8a3 100755 --- a/build-app.sh +++ b/build-app.sh @@ -108,9 +108,9 @@ cat > "$APP/Contents/Info.plist" <<'PLIST' CFBundleIconFile Icon CFBundleShortVersionString - 1.1.2 + 1.1.3 CFBundleVersion - 12 + 13 LSUIElement NSHighResolutionCapable