Skip to content

gongjiantao/Img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

拾碌 (Image <-> Base64 Converter)

English | 中文

🇬🇧 English

Introduction

拾碌 (Shilu) is a lightweight Windows GUI application built with Python and Tkinter. It provides a seamless way to convert images to Base64 strings and vice versa. Designed for developers and designers, it handles large files efficiently and offers a clean, modern interface.

✨ Features

  • Image to Base64:
    • Large File Support: Multi-threaded processing ensures the UI remains responsive even with large images.
    • Smart Preview: Displays only the first 1000 characters of the Base64 string to prevent interface freezing.
    • Auto-generated Filenames: Automatically generates filenames in the format GJT + 6 random digits (e.g., GJT123456.txt) when saving.
    • Export Options: One-click copy to clipboard or save as a .txt file.
  • Base64 to Image:
    • Flexible Input: Import from clipboard, text files, or direct input.
    • Real-time Preview: Instantly view the decoded image.
    • Save as Image: Save decoded images as PNG/JPG with auto-generated filenames (GJT + 6 random digits).
  • Modern UI: Built with ttkbootstrap for a sleek look and feel.

🛠 Requirements

  • Windows OS (Recommended for the pre-built EXE)
  • Python 3.x (If running from source)
  • Dependencies: Pillow, ttkbootstrap

🚀 Installation & Usage

Option 1: Run from Source

  1. Clone the repository:
    git clone https://github.com/yourusername/image-base64-converter.git
    cd image-base64-converter
  2. Install dependencies:
    pip install -r requirements.txt
  3. Run the application:
    python image_converter.py

Option 2: Build Executable (EXE)

If you want to package the app as a standalone .exe file:

  1. Install PyInstaller:
    pip install pyinstaller
  2. Run the build script:
    • Double-click build_exe.bat
    • OR run command:
      pyinstaller --noconfirm --onefile --windowed --name "拾碌" --icon "app_icon.ico" image_converter.py
  3. Find the executable in the dist/ folder.

🇨🇳 中文

简介

拾碌 是一款基于 Python 和 Tkinter 开发的轻量级 Windows 桌面应用,旨在提供便捷的图片与 Base64 字符串互转功能。它专为开发者和设计师打造,界面简洁现代,能够高效处理大文件。

✨ 功能特点

  • 图片转 Base64
    • 支持大文件:采用多线程处理,转换大图片时界面不卡顿。
    • 智能预览:仅显示 Base64 字符串的前 1000 个字符,防止界面冻结。
    • 自动文件名:保存文件时自动生成 GJT + 6位随机数字的文件名(如 GJT123456.txt),无需手动输入。
    • 便捷导出:支持一键复制完整代码到剪贴板或保存为 .txt 文件。
  • Base64 转图片
    • 灵活输入:支持从剪贴板粘贴、导入文本文件或直接输入。
    • 实时预览:解码后立即显示图片预览。
    • 保存图片:支持将解码后的图片保存为 PNG/JPG 格式,同样支持自动生成文件名。
  • 现代界面:使用 ttkbootstrap 构建,提供美观的视觉体验。

🛠 环境要求

  • Windows 操作系统
  • Python 3.x (源码运行)
  • 依赖库:Pillow, ttkbootstrap

🚀 安装与使用

方法 1:源码运行

  1. 克隆项目
    git clone https://github.com/yourusername/image-base64-converter.git
    cd image-base64-converter
  2. 安装依赖
    pip install -r requirements.txt
  3. 运行程序
    python image_converter.py

方法 2:打包为 EXE

如果您想将程序打包为独立的 .exe 可执行文件:

  1. 安装 PyInstaller:
    pip install pyinstaller
  2. 执行打包:
    • 直接运行 build_exe.bat 脚本
    • 或者 在命令行运行:
      pyinstaller --noconfirm --onefile --windowed --name "拾碌" --icon "app_icon.ico" image_converter.py
  3. dist/ 目录下找到生成的可执行文件。

License: MIT

About

图片与Base64相互转换(Image <-> Base64 Converter)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors