# imager **Repository Path**: xsofter/imager ## Basic Information - **Project Name**: imager - **Description**: 图片整合工具 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-05 - **Last Updated**: 2021-11-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # imager ## 介绍 图片整合工具,基于[dromara/image-combiner](https://gitee.com/dromara/image-combiner) 进行重构、二次开发。 ## 文档 更多使用技巧参考:[imager文档](http://www.xsofter.com/2021/11/05/doc/20211105-imager-doc/) ### 1.功能介绍 - [x] 元素透明 - [x] 元素垂直居中 - [x] 元素水平居中 - [x] 元素旋转 - [x] 图片圆角 - [x] 图片缩放 - [x] 图片噪点 - [ ] 图片模糊 - [ ] 图片渐变 - [ ] 图片描边 - [x] 图片翻转(垂直/水平) - [x] 图片去色 - [x] 文本字体 - [x] 文本颜色 - [x] 文本删除线 - [x] 文本下划线 - [x] 文本换行(行高、行宽、行数) - [x] 文本加粗 - [x] 文本倾斜 - [x] 支持导入本地、网络图片 - [x] 支持生成图片文件、base64图片字符串等 ## 改动 ### 流程 新增element元素处理器IProcessor,处理类似文本分行等个性化操作。让IPainter的工作更纯粹。 ```java public interface IProcessor> { void process(T element, List elements); } ``` ### 元素添加 参考spring security的建造者模式,封装了Images类让元素添加一步到位。 ```java @Test public void createPic() throws Exception { Images.of("https://cdn.jsdelivr.net/gh/xShower/statics/website/20211105155747.jpg") .text("我把鲜花藏于身后") .x(50) .y(60) .fontSize(20) .underline(true) .color(Color.WHITE) .and() .text("时刻期待与你相遇") .x(50) .y(80) .fontSize(14) .color(Color.WHITE) .and() // 右下角二维码 .image("https://cdn.jsdelivr.net/gh/xShower/statics/website/my_website.png") .x(500) .y(640) .zoom(ImageOptions.Zoom.WidthHeight) .width(100) .height(100) .radius(20) .alpha(.8f) .and() .picType(ImageOptions.PicType.PNG) .save("e:\\target\\images\\pic.png"); } ``` ## 效果图 ![pic.png](src/main/resources/pic/pic.png)