ImgUtil.java
@Test
public static void imgTest() {
String inputFile = "F:/123/head.png";
String outputFile = "F:/123/head_copy.png";
// String base = "01"; // 替换的字符串
String base = "@#&$%*o!;.";// 字符串由复杂到简单
int threshold = 8;// 阈值
ImgUtil.toTextImg(inputFile, outputFile, base, threshold);
}
- 调整字符大小,颜色
- 调整字符间距
- 调整字符的区域 (index数值越小,灰度越大)
GifUtil.java
测试代码
@Test
public static void gifTest() {
String srcFile = "F:/123/123.gif";
String targetFile = "F:/123/123_04.gif";
String base = "01"; // 替换的字符串
// String base = "@#&$%*o!;.";// 字符串由复杂到简单
int threshold = 3;// 阈值
GifUtil.toTextGif(srcFile, targetFile, base, threshold);
}
FfmpegUtil.java\VideoUtil.java
没做细致的调整,视频的转换可以调调参数
测试代码
@Test
public static void videoTest() {
String srcVideoPath = "F:/123/123.mp4";
String tarImagePath = "F:/123/mp/";
String tarAudioPath = "F:/123/mp/audio.aac";
String tarVideoPath = "F:/123/1234.mp4";
VideoUtil.readVideo(srcVideoPath,tarImagePath,tarAudioPath,tarVideoPath);
}