Icon Forge converts an existing high-resolution icon into Chrome extension assets and a Tauri-compatible desktop/mobile icon set. Background removal is optional and runs locally through rembg; resizing and composition use sharp and @tauri-apps/cli.
| Target | Generated assets |
|---|---|
| Chrome extension | Transparent PNGs at 16, 32, 48, and 128 px by default |
| macOS | icon.icns |
| Windows | icon.ico, Square*Logo.png, and StoreLogo.png |
| Linux | Multi-size RGBA PNGs |
| iOS | Multi-size AppIcon-*.png files |
| Android | Density-specific launcher, round, foreground, and adaptive-icon resources |
Icon Forge generates valid platform file formats from one rounded source image. It does not yet redesign the artwork independently for each platform, so Windows, Linux, iOS, and Android currently inherit the same rounded visual treatment.
- Node.js 20 or newer
- Python 3 with
venvsupport when AI background removal is needed - A high-resolution square PNG is recommended. Other formats supported by
sharpmay work, but are not part of the tested contract.
If background removal is not needed, install only the Node.js dependencies and use --skip-rembg:
npm installFor the complete setup on macOS or Linux:
./setup.shOn Windows PowerShell:
npm install
py -m venv venv
.\venv\Scripts\python.exe -m pip install -r requirements.txtThe tool processes images locally. Dependency installation and the first rembg run may download packages or model data into dependency-managed caches.
node forge.js -i <path-to-source-image> -o <output-directory>Use the original input for extension icons when it already has the intended background or transparency:
node forge.js -i icon.png -o output --skip-rembgRun node forge.js --help for size and padding options. Generated files use stable names and overwrite same-name files in an existing output directory; use a fresh directory when previous results must be preserved.
npm testThe smoke test generates a temporary source image, runs the pipeline without AI background removal, and verifies representative Chrome, macOS, Windows, Linux, iOS, and Android assets. Temporary files are removed after the test.
Icon Forge is licensed under the MIT License.
Icon Forge 将已有的高分辨率图标转换为 Chrome 扩展资源和兼容 Tauri 的桌面端、移动端图标套件。背景移除是可选步骤,通过 rembg 在本地执行;缩放与合成由 sharp 和 @tauri-apps/cli 完成。
| 目标 | 生成资源 |
|---|---|
| Chrome 扩展 | 默认生成 16、32、48、128 px 的透明 PNG |
| macOS | icon.icns |
| Windows | icon.ico、Square*Logo.png 和 StoreLogo.png |
| Linux | 多尺寸 RGBA PNG |
| iOS | 多尺寸 AppIcon-*.png |
| Android | 按 density 生成 launcher、round、foreground 和自适应图标资源 |
Icon Forge 从同一张圆角母图生成各平台所需的文件格式。目前不会为每个平台独立重绘,因此 Windows、Linux、iOS 和 Android 仍会继承相同的圆角视觉处理。
- Node.js 20 或更高版本
- 使用 AI 背景移除时,需要支持
venv的 Python 3 - 推荐输入高分辨率正方形 PNG。
sharp支持的其他格式可能可用,但不属于当前测试合同。
如果不需要背景移除,只需安装 Node.js 依赖,并在运行时使用 --skip-rembg:
npm installmacOS 或 Linux 的完整安装:
./setup.shWindows PowerShell:
npm install
py -m venv venv
.\venv\Scripts\python.exe -m pip install -r requirements.txt图像处理在本地完成。安装依赖以及首次运行 rembg 时,可能会把依赖包或模型数据下载到相关工具管理的缓存目录。
node forge.js -i <输入图片路径> -o <输出目录>如果输入图已经具有期望的背景或透明度,可以跳过 AI 背景移除:
node forge.js -i icon.png -o output --skip-rembg运行 node forge.js --help 查看尺寸和留白选项。生成文件使用固定名称;如果输出目录已有同名文件,会直接覆盖。需要保留旧结果时请使用新的输出目录。
npm testSmoke test 会在临时目录生成测试母图,在跳过 AI 抠图的情况下执行完整流水线,并验证具有代表性的 Chrome、macOS、Windows、Linux、iOS 和 Android 产物;测试结束后会清理临时文件。
Icon Forge 使用 MIT License。