Skip to content

新增批量图片转换功能(格式 / 尺寸 / 通道) #147

Open

Description

@rs1973-bit

功能说明

您好,我最近在使用 python-office 的过程中,注意到目前似乎还没有针对图片的批量处理功能。
我开发了一个基于 Pillow 的小工具,可以批量完成以下任务:

  批量图片格式转换(JPG, PNG, BMP, WEBP, TIFF, GIF);
  可选调整尺寸(支持自动填充白色或透明背景)
  支持 RGBA 通道;
  GIF 合成功能(可设置帧间隔)。

  技术说明:

  依赖库:仅使用 Pillow(轻量、易安装、适合普通办公电脑);
  已在 Windows 环境下测试;

早期曾实现多进程版本,但在 3000 张图片压力测试中 CPU 过载,因此当前采用单线程稳定实现。

想请教

项目目前是否已有类似功能模块?

如果没有,是否欢迎我将此功能整理成子模块提交 PR?

若您方便查看,我可以提供部分核心代码片段或完整脚本以供参考。
感谢您阅读!

Activity

  1. CoderWanFeng commented on Nov 4, 2025

    @CoderWanFeng
    Owner

    欢迎提交pr。注意:在tests文件夹下,增加测试文件。

  2. rs1973-bit commented on Nov 5, 2025

    @rs1973-bit
    ContributorAuthor

    关于“在 tests 文件夹下增加测试文件”,按照您在项目中的提示,我已经在 contributors/<我的GitHub用户名> 下添加了我的代码。
    我注意到 tests/tests_code 中的测试主要针对已有模块,我不太确定该如何写测试来验证我的代码是否正常运行。
    由于我的代码基础还不太好,这是我第一次尝试参与开源项目,可能有些做法比较笨拙,希望不会带来困扰 😅
    如果能提供一个测试模板或者示例,供我参考,我会非常感激。

  3. CoderWanFeng commented on Nov 5, 2025

    @CoderWanFeng
    Owner

    明白。这样的话,你就直接 contributors/<我的GitHub用户名> 完成这个就行了。test我来写

  4. rs1973-bit commented on Nov 5, 2025

    @rs1973-bit
    ContributorAuthor

    感谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions