# picture-handle **Repository Path**: shenjunfang/picture-handle ## Basic Information - **Project Name**: picture-handle - **Description**: 使用java操作图片,可以实现java画个性化海报,并且提供了Thumbnailator的使用demo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-04-09 - **Last Updated**: 2022-07-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # picture-handle

使用java操作图片demo,可以实现java画个性化海报


提供了两个demo,一个是使用java提供的Graphics2D实现画海报,一个是使用google开元的Thumbnailator工具类操作图片。
基本功能可以使用Thumbnailator操作图片,但是定制化的东西它无法完成,所以Thumbnailator可以与Graphics2D结合使用。

本项目提供了一个完整的生产上使用的例子,功能就是根据用户信息给用户定制化海报。

Graphics2DDemo.java

本例子涉及到的功能点有:


1、背景图上添加图片
2、图片去掉棱角
3、画圆形头像
4、图片上写字

Thumbnailator提供的功能有:


1、缩放图片(指定比例)
2、缩放图片(非指定比例)
3、压缩图片
4、裁剪图片
5、旋转图片
6、添加水印(可以设置透明度)
7、批量处理图片

使用Thumbnailator时需要先引入jar包:
<dependency>
    <groupId>net.coobird</groupId>
    <artifactId>thumbnailator</artifactId>
    <version>0.4.8</version>
</dependency>