thumbnailator

coobirdMIT更新放缓

Java 缩略图生成库,用链式调用几行代码就能完成图片缩放、裁剪和加水印,省去手写 ImageIO 和 Graphics2D 的麻烦。

Thumbnailator - a thumbnail generation library for Java

暂无版本5,428star787fork同步于 2026-11-10 11:36 UTC

怎么上手

由 README 提炼,执行前请确认
<dependency>
  <groupId>net.coobird</groupId>
  <artifactId>thumbnailator</artifactId>
  <version>0.4.21</version>
</dependency>
硬件要求按 README 说明

README 未说明,纯 Java 库,不涉及 GPU 或显存要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Java 缩略图生成库,封装 Image I/O 与 Java 2D,一行链式调用完成高质量缩放

Java 缩略图生成库,用链式调用几行代码就能完成图片缩放、裁剪和加水印,省去手写 ImageIO 和 Graphics2D 的麻烦。

核心能力

  • 用链式 API 一步完成缩放、输出格式与批量处理
  • 自动保持原图宽高比,按最大尺寸约束缩放
  • 支持批量处理目录下多个文件并按前缀重命名输出
  • 单个 JAR 无外部依赖,可直接引入 Maven 项目
  • 内部封装 Image I/O 与 Graphics2D,无需手写图像处理代码

容易踩的坑

README 声明 API 仍处于早期开发阶段,可能随时变更;README 未给出 Maven 坐标细节,需查阅项目 Maven wiki 页确认 groupId 与 artifactId

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    October 1, 2025: Thumbnailator 0.4.21 has been released! See Changes for details.

    Thumbnailator is now available through Maven!

    What is Thumbnailator?

    Thumbnailator is a thumbnail generation library for Java.

    Why Thumbnailator?

    Making high-quality thumbnails in Java can be a fairly difficult task.

    Learning how to use the Image I/O API, Java 2D API, image processing, image scaling techniques, ... but fear not! Thumbnailator will take care of all those things for you!

    Thumbnailator is a single JAR file with no dependencies to external libraries, making development and deployment simple and easy. It is also available on the Maven Central Repository for easy inclusion in Maven projects.

    How simple is Thumbnailator?

    Thumbnailator's fluent interface can be used to perform fairly complicated thumbnail processing task in one simple step.

    For example, creating JPEG thumbnails of image files in a directory, all resized to a maximum dimension of 640 pixels by 480 pixels while preserving the aspect ratio of the original image can be performed by the following:

    Thumbnails.of(new File("path/to/directory").listFiles())
        .size(640, 480)
        .outputFormat("jpg")
        .toFiles(Rename.PREFIX_DOT_THUMBNAIL);
    

    The fluent interface provided by the Thumbnailator simplifies the task of making thumbnails into a single method call!

    No need to access the Image I/O API and manually manipulate BufferedImages through Graphics2D objects. Thumbnailator does all of that for you.

    What can Thumbnailator do?

    The following pages have more information on what Thumbnailator can do:

    Disclaimer

    Thumbnailator is still early in its development, and the APIs are subject to change at any time.

    License

    Thumbnailtor is released under the MIT License.