Skip to main content

JPEG2GIF

Project description

PyPI Python Version License

将多个 JPEG/JPG 图像合并为一个动画 GIF 的轻量级 Python 工具。

简单、快速、无需复杂配置。

📦 安装

使用 pip 安装:

pip install JPEG2GIF
依赖项 Pillow 会自动安装。🚀 快速使用1. 基本用法from JPEG2GIF import convert_images_to_gif

# 指定图像路径列表
image_paths = ["image1.jpg", "image2.jpg", "image3.jpg"]

# 转换为 GIF
convert_images_to_gif(image_paths, "output.gif")
2. 自定义参数convert_images_to_gif(
    image_paths,
    output_path="animated.gif",
    duration=500,      # 每帧显示时间(毫秒)
    loop=0,            # 循环次数(0 表示无限循环)
    resize=None,       # 可选:调整图像大小,如 (800, 600)
    optimize=True      # 优化 GIF 文件大小
)
3. 使用通配符批量处理import glob
from JPEG2GIF import convert_images_to_gif

# 自动匹配所有 .jpg 和 .jpeg 文件
image_paths = sorted(glob.glob("frames/*.jpg") + glob.glob("frames/*.jpeg"))
convert_images_to_gif(image_paths, "result.gif", duration=200)
🖼️ 命令行使用(CLI)安装后,可直接在终端使用:# 基本用法
jpeg2gif image1.jpg image2.jpg image3.jpg -o animation.gif

# 设置帧延迟和循环
jpeg2gif *.jpg -o output.gif --duration 300 --loop 1

# 查看帮助
jpeg2gif --help
🧩 功能特性
•✅ 支持 .jpg  .jpeg 格式
•✅ 可调节帧延迟(duration)
•✅ 支持无限或有限循环(loop)
•✅ 可选图像缩放(resize)
•✅ 启用 GIF 优化以减小文件大小
•✅ 支持命令行和 Python API 两种调用方式
⚙️ 开发者安装开发依赖pip install -e .
pip install -r dev-requirements.txt  # 或使用 pyproject.toml 中的 dev 依赖
运行测试pytest tests/
📄 许可证本项目基于 MIT 许可证 开源。📬 反馈与问题欢迎提交 issue  PR:
 👉 https://github.com/uag515/JPEG2GIF/issues作者:uag515 uag515@sina.com
---

## ✅ 说明

- **替换链接**:请将 `https://github.com/uag515/JPEG2GIF` 替换为你真实的 GitHub/GitLab 仓库地址。
- **功能假设**:此 README 假设你的包提供了 `convert_images_to_gif` 函数和 `jpeg2gif` CLI 命令。如果实际 API 不同,请根据你的代码调整示例。
- **可扩展**:你可以添加“示例 GIF 图”、“性能对比”、“常见问题”等章节。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jpeg2gif-0.0.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jpeg2gif-0.0.5-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file jpeg2gif-0.0.5.tar.gz.

File metadata

  • Download URL: jpeg2gif-0.0.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for jpeg2gif-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0dd8cbcff89370172f14e34cfa5dabc98562469866c3ba2d765471b1b21c6034
MD5 b6a5850da85a9217f593dc1ec288ba56
BLAKE2b-256 2b27adcda73ac8a7421ed109563417cbf8438a6ff370271785aa8c48a65e7fd8

See more details on using hashes here.

File details

Details for the file jpeg2gif-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: jpeg2gif-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for jpeg2gif-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c3fe80be1094b95ed20ac74ba5099f314d8ae62e4af5a651b125dbee1b111296
MD5 4028aeb1225273000cd4400661094285
BLAKE2b-256 b03b0b29f470eb797b3251bf356fc82d53ab2631309a1e296370c1b5f45f450f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page