首页>>后端>>java->Java实现GIF图转字符动图实例demo

Java实现GIF图转字符动图实例demo

时间:2023-12-02 本站 点击:0

上一篇文章介绍了静态图转字符的实现demo;接下来也该是动态图转字符的demo了

从前面几篇文章的学习过程中,要想实现这个功能就属于信手拈来了

单张图转字符完成之后,动图无非是每一张静态图都转一遍,保存最后的结果即可

这里我们就不介绍基础的JDK写法了(感兴趣的可以到前面几篇文章中获取),我们直接进入进阶的玩法

接下来我们借助开源项目 https://github.com/liuyueyi/quick-media 来迅速的实现输出Gif字符图

@TestpublicvoidtestCharLines(){Stringfile="https://c-ssl.duitang.com/uploads/item/201707/11/20170711194634_nTiK5.thumb.1000_0.gif";java.util.List<java.util.List<String>>list=ImgPixelWrapper.build().setSourceImg(file).setBlockSize(3).setRate(0.6).setPixelType(PixelStyleEnum.CHAR_COLOR).build().asChars();for(List<String>s:list){for(Stringt:s){System.out.println(t);}System.out.println("-------分割-------");}}

注意上面的实现,List<String> 表示一个张字符图,一个gif图可以转换成多个

具体的输出字符太多,这里简单截取几个看一看效果

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$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$$$$$$$$$$$$$$$$$$$$$$

微信公众号:一灰灰blog


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:/java/10458.html