Skip to content

Repository files navigation

🖼️ Icon Toolbox / 图标工具箱

PNG ↔ ICO converter + EXE icon replacer — a cross-platform desktop application built with Electron.

PNG ↔ ICO 转换器 + EXE 图标替换工具 — 基于 Electron 构建的跨平台桌面应用。

English | 中文


English

Features

Tool Description
PNG ↔ ICO Converter Bidirectional conversion between PNG and ICO formats. Supports BMP-embedded legacy ICO files. Pure client-side, no server required.
EXE Icon Replacer Replace or extract icons from Windows executable files (.exe, .dll). Uses resedit to directly manipulate PE resources without external tools.

Quick Start

One-click launch (Windows):

File Behavior
run.bat (双击) 带控制台窗口,可看到启动日志。出错时暂停。
run-silent.bat (双击) 控制台启动后自动关闭。
run.vbs (双击) 完全静默,无控制台窗口。

Command line:

# Install dependencies
npm install

# Launch desktop app
npm start

# (Optional) Generate app icon
npm run generate-icon

# (Optional) Browser-based server for EXE tool only
npm run start:icon-server
# Then open http://localhost:3456

Note for VS Code users: If you see process.type: undefined errors, run:

npm run start:no-env

This clears the ELECTRON_RUN_AS_NODE environment variable that VS Code sets.

Project Structure

├── run.bat                      # 🚀 Double-click launcher (with console)
├── run-silent.bat               # 🚀 Double-click launcher (auto-close console)
├── run.vbs                      # 🚀 Silent launcher (no console at all)
├── main.js                     # Electron main process
├── preload.js                  # Context bridge (IPC)
├── index.html                  # Desktop UI (tabs + i18n)
├── make-icon.js                # Programmatic icon generator
├── png-ico-converter.html      # Standalone browser version (Tool 1)
├── exe-icon-changer.html       # Browser UI (Tool 2)
├── exe-icon-server.js          # Express server (Tool 2 backend)
├── app-icon.ico                # Application icon
└── package.json

Tech Stack

Layer Technology
Desktop Shell Electron 43
Runtime Node.js 24
PE Resource Editing resedit
Image Processing HTML5 Canvas API, zlib
Server (browser ver.) Express 5 + Multer 2
I18n Custom lightweight implementation

Usage

Tool 1: PNG ↔ ICO Converter

  1. Launch the app, stay on the PNG ↔ ICO tab
  2. Drag a PNG or ICO file onto either drop zone (or click to select)
  3. Click Convert — the converted file appears in the other zone and downloads automatically
  4. Click Clear to reset both zones

Note: Dropping a file on one zone clears the other zone automatically.

Tool 2: EXE Icon Replacer

  1. Switch to the EXE Icon Replacer tab
  2. Drag an .exe (or .dll) file onto the left zone
  3. Drag an .ico file onto the right zone
  4. Click Replace Icon to create a new EXE with the ICO embedded
  5. Click Extract Icon to export the EXE's current icons as an ICO file

Changelog

v1.10.1 (2026-07-18)

  • ✨ Add: Multi-image ICO mode — toggle to switch from single-image to gallery mode
  • ✨ Add: Gallery card UI with drag-drop per resolution, first image auto-fills all sizes
  • ✨ Add: Inline size input for adding custom resolutions (1–1024px)
  • ✨ Add: Expanded image format support — PNG, JPEG, WebP, BMP, GIF, SVG, TIFF, AVIF
  • ✨ Add: Tab label updated to "Image ↔ ICO" / "图片 ↔ ICO"
  • 🐛 Fix: Large EXE file (>100MB) IPC crash — use file paths instead of array serialization
  • 🐛 Fix: File.path unavailable under contextIsolation — use webUtils.getPathForFile()
  • 🐛 Fix: fs.readFileSync().buffer pool corruption — use Buffer directly with resedit
  • 🐛 Fix: Card delete button hidden when no image loaded — now visible on hover
  • 🐛 Fix: Duplicate toast on adding new size — added execution guard

v1.00.2 (2026-07-18)

  • 🐛 Fix: EXE icon replacer now allows both EXE and ICO files to coexist simultaneously
  • 🔧 Adjust: Window default height increased to 720px, min height to 600px
  • 🔧 Adjust: About card layout compacted for better fit
  • 🌐 Add: Chinese/English language switching with i18n system
  • 📄 Add: About tab with author, version, and project info
  • 📄 Add: README.md with bilingual documentation and usage guide
  • 🚀 Add: One-click launcher scripts (run.bat, run-silent.bat, run.vbs)
  • 🎨 Add: Programmatic app icon generation (make-icon.js)

v1.00.1 (2026-07-18)

  • ✨ Initial release
  • ✨ PNG ↔ ICO bidirectional conversion
  • ✨ EXE icon replacement & extraction via Electron IPC
  • ✨ Drag-and-drop UI with mutual-exclusion logic
  • ✨ Toast notifications and progress overlay
  • ✨ Standalone browser versions for both tools

中文

功能

工具 说明
PNG ↔ ICO 转换器 PNG 与 ICO 格式双向转换。支持 BMP 内嵌的旧式 ICO。纯客户端运行,无需服务器。
EXE 图标替换 替换或提取 Windows 可执行文件(.exe / .dll)的图标。使用 resedit 直接操控 PE 资源,无需外部工具。

快速开始

一键启动(Windows):

文件 行为
run.bat (双击) 带控制台窗口,可看到启动日志。出错时暂停。
run-silent.bat (双击) 控制台启动后自动关闭。
run.vbs (双击) 完全静默,无控制台窗口。

命令行:

# 安装依赖
npm install

# 启动桌面应用
npm start

# (可选)生成应用图标
npm run generate-icon

# (可选)浏览器版服务器(仅工具二)
npm run start:icon-server
# 然后打开 http://localhost:3456

VS Code 用户注意: 如果遇到 process.type: undefined 错误,请运行:

npm run start:no-env

这会清除 VS Code 终端中的 ELECTRON_RUN_AS_NODE 环境变量。

项目结构

├── run.bat                      # 🚀 双击启动(带控制台)
├── run-silent.bat               # 🚀 双击启动(控制台自动关)
├── run.vbs                      # 🚀 静默启动(无控制台)
├── main.js                     # Electron 主进程
├── preload.js                  # 上下文桥接(IPC)
├── index.html                  # 桌面版界面(标签页 + 国际化)
├── make-icon.js                # 程序化图标生成器
├── png-ico-converter.html      # 浏览器独立版(工具一)
├── exe-icon-changer.html       # 浏览器版界面(工具二)
├── exe-icon-server.js          # Express 服务器(工具二后端)
├── app-icon.ico                # 应用图标
└── package.json

🚀 一键启动: Windows 用户可直接双击 run.batrun-silent.batrun.vbs 启动应用,无需手动输入命令。

技术栈

层级 技术
桌面框架 Electron 43
运行时 Node.js 24
PE 资源编辑 resedit
图像处理 HTML5 Canvas API, zlib
服务器(浏览器版) Express 5 + Multer 2
国际化 自实现轻量方案

使用方法

工具一:PNG ↔ ICO 转换器

  1. 启动应用,停留在 PNG ↔ ICO 标签页
  2. 将 PNG 或 ICO 文件拖到任意一个拖放块中(或点击选择)
  3. 点击 转换 — 转换后的文件出现在另一侧块中并自动下载
  4. 点击 清空 重置两个块

注意: 向一个块拖入文件时,另一个块的文件会自动清空。

工具二:EXE 图标替换

  1. 切换到 EXE 图标替换 标签页
  2. .exe(或 .dll)文件拖到左侧块中
  3. .ico 文件拖到右侧块中
  4. 点击 替换图标 生成嵌入了新图标的新 EXE 文件
  5. 点击 提取图标 将 EXE 当前的图标导出为 ICO 文件

更新日志

v1.10.1 (2026-07-18)

  • ✨ 新增:多图 ICO 模式 — 开关切换单图/画廊模式
  • ✨ 新增:画廊卡片 UI,支持每分辨率独立拖放,首图自动填充全部尺寸
  • ✨ 新增:内联输入框添加自定义分辨率(1–1024px)
  • ✨ 新增:扩展图片格式支持 — PNG、JPEG、WebP、BMP、GIF、SVG、TIFF、AVIF
  • ✨ 新增:标签页更名为「图片 ↔ ICO」
  • 🐛 修复:大文件(>100MB)IPC 传输崩溃 — 改用文件路径传递
  • 🐛 修复:contextIsolation 下 File.path 不可用 — 改用 webUtils.getPathForFile()
  • 🐛 修复:fs.readFileSync().buffer 池污染 — 直接使用 Buffer
  • 🐛 修复:卡片 × 按钮未加载图片时不可见 — 改为悬停显示
  • 🐛 修复:添加新尺寸时重复 toast — 添加防重入标志

v1.00.2 (2026-07-18)

  • 🐛 修复:EXE 图标替换工具现在允许 EXE 和 ICO 两个文件同时存在
  • 🔧 调整:窗口默认高度增至 720px,最小高度 600px
  • 🔧 调整:关于卡片布局更紧凑,适配窗口
  • 🔧 调整:自定义暗色主题滚动条样式
  • 🌐 新增:中英文切换与 i18n 系统
  • 📄 新增:关于标签页(作者、版本、项目信息)
  • 📄 新增:README.md 中英双语文档与使用指南
  • 🚀 新增:一键启动脚本(run.bat, run-silent.bat, run.vbs)
  • 🎨 新增:程序化应用图标生成(make-icon.js)

v1.00.1 (2026-07-18)

  • ✨ 初始版本发布
  • ✨ PNG ↔ ICO 双向转换
  • ✨ EXE 图标替换与提取(通过 Electron IPC)
  • ✨ 拖放界面,互斥逻辑
  • ✨ Toast 通知与进度遮罩
  • ✨ 浏览器独立版本(两个工具)

License / 许可证

MIT © 2026 dboycht


GitHub Version License

About

ICO converter, provides PNG to ICO, add ICO to EXE applications

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages