| 图标 | 工具 | 说明 |
|---|---|---|
| 🗜️ | 图片压缩 | 批量压缩 JPG/PNG/WebP,可调质量,支持格式互转 |
| 🔁 | 图片格式转换 | 批量转换 JPEG/PNG/WebP/BMP/TIFF/GIF 六种格式 |
| 🧩 | 图片拼接 | 多张图片横向或纵向拼成一张,支持对齐设置 |
| 🖨️ | 图片转PDF | 多张图片合并为一个 PDF,支持拖拽排序 |
| 🔍 | 图片缩放 | 批量调整尺寸,支持按比例/宽度/高度/指定宽高 |
| 📚 | PDF合并 | 多个 PDF 合并为一个,支持拖拽调整顺序 |
| 📃 | PDF拆分 | 拆分 PDF 为图片或单页 PDF,支持自定义页数 |
| 🔂 | 文件去重 | 按内容 Hash 查找重复文件,支持预览和批量删除 |
plugins/ 目录即可自动加载| 功能 | 截图 |
|---|---|
| 首页 | ![]() |
| 图片压缩 | ![]() |
| 图片格式转换 | ![]() |
| 图片拼接 | ![]() |
| 图片转PDF | ![]() |
| 图片缩放 | ![]() |
| PDF合并 | ![]() |
| PDF拆分 | ![]() |
| 文件去重 | ![]() |
| 设置 | ![]() |
pip install -r requirements.txt
依赖包说明:
| 包 | 用途 |
|---|---|
| PyQt6 | GUI 框架 |
| Pillow (PIL) | 图片处理 |
| img2pdf | PDF 转换(首选) |
| PyMuPDF (fitz) | PDF 转换(备选) |
python main.py
# 推荐使用 spec 文件打包(已包含所有必要模块)
pyinstaller toolbox.spec
# 使用 UPX 压缩减小体积
pyinstaller --upx-dir=/path/to/upx toolbox.spec
⚠️ 注意:必须使用
toolbox.spec进行打包,直接运行pyinstaller main.py会导致动态加载的插件模块缺失。
工具箱支持插件扩展,将 Python 文件放入 plugins/ 目录即可自动加载。
新建 plugins/my_tool.py:
# -*- encoding: utf-8 -*-
"""
我的工具插件
"""
from toolbox import ToolPlugin, Card, AnimatedButton, Theme
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QLabel
class MyTool(ToolPlugin):
name = "我的工具"
description = "工具描述"
icon = "🔧"
def create_ui(self) -> QWidget:
"""创建工具界面"""
widget = QWidget()
layout = QVBoxLayout(widget)
layout.addWidget(QLabel("Hello, World!"))
return widget
def apply_theme(self, theme):
"""响应主题切换(可选)"""
pass
在 config.py 的 PLUGIN_MODULES 中添加配置:
{
"name": "我的工具",
"icon": "🔧",
"description": "工具描述",
"order": 30, # 排序权重,越小越靠前
"module": "plugins.my_tool",
"class": "MyTool",
}
| 文件 | 类名 | 功能 |
|---|---|---|
plugins/image_compressor.py |
ImageCompressor |
图片压缩 |
plugins/image_format_converter.py |
FormatConverter |
图片格式转换 |
plugins/image_stitcher.py |
ImageStitcher |
图片拼接 |
plugins/image_to_pdf.py |
ImageToPDF |
图片转 PDF |
plugins/image_scaler.py |
ImageScaler |
图片缩放 |
plugins/pdf_merger.py |
PDFMerger |
PDF 合并 |
plugins/pdf_splitter.py |
PDFSplitter |
PDF 拆分 |
plugins/file_deduplicator.py |
FileDeduplicator |
文件去重 |
应用配置集中在 config.py 文件中:
| 配置项 | 说明 |
|---|---|
APP_NAME, APP_VERSION |
应用名称和版本号 |
APP_DESCRIPTION, APP_COPYRIGHT |
应用描述和版权信息 |
APP_WEBSITE_URL |
官方网站链接 |
PLUGIN_MODULES |
插件列表(名称、图标、描述、排序) |
UI_CONFIG |
窗口大小、侧边栏宽度等 UI 设置 |
THEME_CONFIG |
主题相关配置 |
WELCOME_CONFIG |
欢迎页面文本内容 |
修改 config.py 即可自定义应用外观和信息,无需修改主程序代码。
# 1. 生成版本信息文件
python generate_version_info.py
# 2. 验证打包依赖
python verify_packaging.py
# 3. 打包为 EXE
pyinstaller toolbox.spec
打包后的 EXE 文件位于 dist/ 目录下。
暂无
欢迎提交 PR 贡献新插件或功能!
本项目为开源项目,使用MIT协议,欢迎自由使用和贡献。