tigra-image-library/ascii-art
Composer 安装命令:
composer require tigra-image-library/ascii-art
包简介
This class can generate a text that looks like a given image. It traverses the pixels of a given image and converts the color values of each region to a character text, so when you look at the sequence of converted characters it looks like the original image. The result text can optionally be output
关键字:
README 文档
README
Introduction
This class can generate a text that looks like a given image.
It traverses the pixels of a given image and converts the color values of each region to a character text, so when you look at the sequence of converted characters it looks like the original image.
The result text can optionally be outputted formatted as HTML and be displayed in color.
Sample output
Original image
ASCII art after image crop
Code example
<?php use Tigra\AsciiArt\Generator; require_once('generator.php'); $x = new Generator('example.jpg'); $color = $x->getBackgroundColor()->getHexValue(); ?> <html> <head> <title>ASCII art demo</title> </head> <body bgcolor="#<?php echo $color; ?>"> <?php $x->setFontSize(6); $x->show(range("a", "z"), 0.25, true, true); ?> </body> </html>
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-only
- 更新时间: 2018-03-11