Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icon Forge

English | 中文

English

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.

Outputs

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.

Requirements

  • Node.js 20 or newer
  • Python 3 with venv support when AI background removal is needed
  • A high-resolution square PNG is recommended. Other formats supported by sharp may work, but are not part of the tested contract.

Installation

If background removal is not needed, install only the Node.js dependencies and use --skip-rembg:

npm install

For the complete setup on macOS or Linux:

./setup.sh

On Windows PowerShell:

npm install
py -m venv venv
.\venv\Scripts\python.exe -m pip install -r requirements.txt

The tool processes images locally. Dependency installation and the first rembg run may download packages or model data into dependency-managed caches.

Usage

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-rembg

Run 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.

Verification

npm test

The 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.

License

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.icoSquare*Logo.pngStoreLogo.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 install

macOS 或 Linux 的完整安装:

./setup.sh

Windows 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 test

Smoke test 会在临时目录生成测试母图,在跳过 AI 抠图的情况下执行完整流水线,并验证具有代表性的 Chrome、macOS、Windows、Linux、iOS 和 Android 产物;测试结束后会清理临时文件。

许可证

Icon Forge 使用 MIT License

About

🎨 Convert icons into Chrome extension & Tauri multi-platform assets with local AI bg removal | 一键将图标转换为 Chrome 扩展与 Tauri 全平台图标套件(支持本地 AI 抠图)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages