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