ASCIIPlayer是一个基于Image2ASCII的ASCII码播放器,能够播放图片,gif动图,视屏(还在开发中)等,提供了类库和命令行工具方便使用。git
HomePage: https://github.com/qeesung/as... 欢迎Star github
先上一个效果图bash
而后将转换之后的ASCII图片输出到不一样的IO中去,其中包括:服务器
+---------------+ +---------+ | | | | +------> Gif Decoder | +---> Encoder +---> file | | | | | | | +---------------+ | +---------+ | +---------------+ +-------------+ | +---------+ | | | | | | | | Input File+------> Image Decoder +---> Frames +-->+ Image2ASCII +->ASCII Frames-+---> Player +---> stdout | | | | | | | | | +---------------+ +-------------+ | +---------+ | +---------------+ | +---------+ | | | | | | +------> Video Decoder | +---> Server +---> socket | | | | +---------------+ +---------+
go get -u github.com/qeesung/asciiplayer
_ ____ ____ ___ ___ ____ _ _ __ _______ ____ / \ / ___| / ___|_ _|_ _| _ \| | / \\ \ / / ____| _ \ / _ \ \___ \| | | | | || |_) | | / _ \\ V /| _| | |_) | / ___ \ ___) | |___ | | | || __/| |___ / ___ \| | | |___| _ < /_/ \_\____/ \____|___|___|_| |_____/_/ \_\_| |_____|_| \_\ >>>Version : 1.0.0 >>>Author : qeesung >>>HomePage : https://github.com/qeesung/asciiplayer asciiplayer is a library that can convert gif and video to ASCII image and provide the cli for easy use. Usage: asciiplayer [command] Available Commands: encode Encode gif or video to ascii gif or video help Help about any command play Play the gif and video in ASCII mode server Server command setup a http share server version Show the version Flags: -D, --debug Switch log level to DEBUG mode -h, --help help for asciiplayer Use "asciiplayer [command] --help" for more information about a command.
播放命令直接在终端中播放对应的媒体,好比PNG和GIF图片。curl
能够经过asciiplayer play -h
来得到更多细节socket
经过适配屏幕的方式播放GIFide
asciiplayer play demo.gif
缩小为原来的十分之一,而后播放GIF工具
asciiplayer play demo.gif -r 0.1
缩放成固定的长和宽,而后播放GIF编码
asciiplayer play demo.gif -w 100 -h 40
播放一个PNG图片url
asciiplayer play demo.png
编码命令能够将一个PNG图片或者是GIF动图,视屏文件转化成一个ASCII的文件
能够运行asciiplayer encode -h
来得到更多细节
输入文件eye.gif
输出文件ascii_eye.gif
讲一个GIF文件demo.gif编码为ASCII的Gif文件output.gif
asciiplayer encode demo.gif -o output.gif
指定输出ASCII字符大小的状况下,讲一个GIF文件demo.gif编码成ASCII的GIF动图文件output.gif
asciiplayer encode demo.gif -o output.gif --font_size=5
将GIF动图demo.gif缩放为原来的十分之一,而后编码成ASCII的GIF动图文件output.gif
asciiplayer encode demo.gif -o output.gif -r 0.1
编码一个jpeg文件,而后输出一个ASCII的output.png文件
asciiplayer encode demo.jpeg -o output.png
能够搭建一个Http Server,而后将转换之后的图片分享到远端的客户端。
搭建服务
$ asciiplayer server demo.gif # Server available on : http://0.0.0.0:8080
远端访问
$ curl http://hostname:8080 # play ascii image here
能够经过运行命令asciiplayer server --help
来得到更多细节
输入demo.gif,并以默认端口8080启动一个http服务器
asciiplayer server demo.gif
输入demo.gif,并以自定义端口8888启动一个http服务器
asciiplayer server demo.gif --port 8888
输入一个demo.png图片,而且启动http 服务器
asciiplayer server demo.png
Raw Image | ASCII Image |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
HomePage: https://github.com/qeesung/as... 欢迎Star