协助处理照片的玩具方案
将一张照片修改为乱码组成的黑白照片,上图
原始图片
转换后
基本方法如下(非全部代码,只是主要方法)
- 获取原始像素点数据并转换
public ConvertImage2Txt(String imagePath, String symbols) {
this.imagePath = imagePath;
this.symbols = StringUtils.isEmpty(symbols) ? Const.SYMBOLS : symbols;
this.newPath = "";
}
private List<String> startConvert() throws IOException {
File image = new File(imagePath);
BufferedImage bi = ImageIO.read(image);