-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Describe the bug
When using tauri icon with a transparent-background source (PNG or SVG), the output icons show a faint gray/uneven fringe around curved edges (e.g., circles). Edges show semi-transparent or tinted pixels (light grey) around curved shapes and transparency boundaries.
Reproduction
- Create a circular logo image with transparency (e.g., white circle on transparent background) in PNG or export as SVG (example attached).
-
Run
tauri icon. -
Examine the generated icons, you’ll see a light gray fringe around the outer edge of the shape.
Expected behavior
Output icons should have clean edges, outer pixels for transparent regions should be fully transparent and have zero RGB bleed
Full tauri info output
[✔] Environment
- OS: Windows 10.0.26200 x86_64 (X64)
✔ WebView2: 141.0.3537.71
✔ MSVC: Visual Studio Community 2022
✔ rustc: 1.90.0 (1159e78c4 2025-09-14)
✔ cargo: 1.90.0 (840b83a10 2025-07-30)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 22.20.0
- pnpm: 10.17.1
- npm: 10.9.3
[-] Packages
- tauri 🦀: 2.8.5
- tauri-build 🦀: 2.4.1
- wry 🦀: 0.53.3, (outdated, latest: 0.53.4)
- tao 🦀: 0.34.3, (outdated, latest: 0.34.4)
- @tauri-apps/api : 2.8.0
- @tauri-apps/cli : 2.8.4
[-] Plugins
- tauri-plugin-global-shortcut 🦀: 2.3.0
- @tauri-apps/plugin-global-shortcut : 2.3.0
- tauri-plugin-dialog 🦀: 2.4.0
- @tauri-apps/plugin-dialog : 2.4.0
- tauri-plugin-deep-link 🦀: 2.4.3
- @tauri-apps/plugin-deep-link : 2.4.3
- tauri-plugin-updater 🦀: 2.9.0
- @tauri-apps/plugin-updater : 2.9.0
- tauri-plugin-store 🦀: 2.4.0
- @tauri-apps/plugin-store : 2.4.0
- tauri-plugin-process 🦀: 2.3.0
- @tauri-apps/plugin-process : 2.3.0
- tauri-plugin-opener 🦀: 2.5.0
- @tauri-apps/plugin-opener : 2.5.0
- tauri-plugin-single-instance 🦀: 2.3.4
- @tauri-apps/plugin-single-instance : not installed!
- tauri-plugin-positioner 🦀: 2.3.0
- @tauri-apps/plugin-positioner : 2.3.0
- tauri-plugin-fs 🦀: 2.4.2
- @tauri-apps/plugin-fs : not installed!
[-] App
- build-type: bundle
- CSP: ...
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React
- bundler: Vite
Stack trace
Additional context
It appears the icon generator’s resizing pipeline (using image::imageops::resize_exact(...) with FilterType::Lanczos3) operates on non-premultiplied RGBA data, causing RGB “leak” from semi-transparent edge pixels during downscaling. A fix could be to premultiply alpha before resizing, then unpremultiply afterward, and optionally set fully transparent pixels’ RGB to 0 to prevent color bleed while keeping smooth antialiased transparency.