Fetch the repository succeeded.
This action will force synchronization from 小帅丶/imagetool, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
├── cn.xsshome.imagetool //包名
├── convert
│ └── ImageToChar //图片转字符图片、文本方法
├── util
│ └── AnimatedGifEncoder //GIF所需工具类代码
│ └── Base64Util //图片数据转base64编码工具类
│ └── GifDecoder //Gif图片处理工具类代码
│ └── GifImageUtil //GIF图片添加文字特效工具类代码
│ └── LZWEncoder //图片处理所需工具类代码
│ └── MergeImageUtil //图片特效合并工具类代码
│ └── NeuQuant //图片处理所需工具类代码
│ └── PngColoringUtil //透明图片增加背景色工具类代码
│ └── RotateImageUtil //图片旋转工具类代码
│ └── ImageWaterMarkUtil //图片增加水印工具类代码
├── zoom
└── └── ImageHelper //图片缩放工具类代码
public class Sample {
public static void main(String[] args) throws Exception {
ImageToChar.load("G:/phone.jpg", "F:/gif/woman.txt");//静态图片转字符保存为txt文件
ImageToChar.loadGif("C:/Users/Administrator/Desktop/页面录屏显示.gif", "F:/gif/");//动图转为动态的字符图片
BufferedImage bi = null;
bi = ImageIO.read(new File("G:/body.jpg"));
String bytePic = ImageToChar.txtToImageByBase64(bi);//静态图转字符 返回转换后图片的base64
System.out.println(bytePic);
}
}
public static void main(String[] args) throws Exception{
String image = "F:\\testimg\\1011.png";//原始图片路径
String resultImage = "F:\\testimg\\10111700.jpg";//处理后保存的图片路径
changePNGBackgroudColor(image,resultImage, Color.pink);//Color.pink 即图片背景颜色
}
public class RotateSample {
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
BufferedImage src = ImageIO.read(new File("E:\\testimg\\glassess.png"));//原图片本地路径
BufferedImage des = RotateImageUtil.rotateImage(src,20);//旋转的角度
ImageIO.write(des, "png", new File("E:\\testimg\\glassess2.png"));//旋转后保存的图片
long end = System.currentTimeMillis();
System.out.println("开始时间:" + start+ "; 结束时间:" + end+ "; 总共用时:" + (end - start) + "(ms)");
}
}
public static void main(String[] args) throws Exception {
GifImageUtil gifImageUtil = new GifImageUtil();
String imagesavePath = "C:\\Users\\xiaoshuai\\Desktop";//图片保存路径
String imagesaveName = String.valueOf(System.currentTimeMillis());//图片保存名称 不包含后缀名
String image = "C:\\Users\\xiaoshuai\\Desktop\\db.gif";//原始图片
String result = gifImageUtil.gifAddText(imagesavePath,imagesaveName,"微软雅黑",25,Color.pink,image,"图片添加文字","测试一下","1234","4567");
System.out.println(result);
}
public static void main(String[] args) {
System.out.println(PngConvertUtil.transparentImg("F:/testimg/hand.jpg", "F:/testimg/hand2020.png"));
}
public static void main(String[] args) {
//水印图片在指定位置
BufferedImage image1 = ImageWaterMarkUtil.addImgWaterMark("F://testimg//water.png", "F://testimg//gjy2.jpg", 4);
File file = new File("F:\\testimg\\2020082701.jpg");
ImageIO.write(image1, "jpg", file);
//文本水印 铺满图片
BufferedImage image2 = ImageWaterMarkUtil.addFullTextWaterMark("F://testimg//gjy2.jpg","小帅丶代码");
File file2 = new File("F:\\testimg\\2020082702.jpg");
ImageIO.write(image2, "jpg", file2);
//图片水印 铺满图片
BufferedImage image3 = ImageWaterMarkUtil.addFullImgWaterMark("F://testimg//gjy2.jpg","F://testimg//water.png");
File file3 = new File("F:\\testimg\\2020082703.jpg");
ImageIO.write(image3, "jpg", file3);
}
public static void main(String[] args) throws Exception{
//最好保证宽或高一致
BufferedImage src = ImageIO.read(new File("F:\\testimg\\gjy2.jpg"));//背景图
BufferedImage png = ImageIO.read(new File("F:\\testimg\\banner.png"));//透明图
BufferedImage image = MergeImageUtil.mergePendant(src, png, 0, 0, 1);
File file = new File("F:\\testimg\\banner320.jpg");//输出图片路径
ImageIO.write(image, "jpg", file);
}
小帅丶代码
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。