ixnode/php-cli-image

PHP Cli Image - 这个库可以将给定的图像转换为ASCII字符串。

0.1.3 2024-05-23 23:32 UTC

This package is auto-updated.

Last update: 2024-09-24 00:07:15 UTC


README

Release PHP PHPStan PHPUnit PHPCS PHPMD Rector - Instant Upgrades and Automated Refactoring LICENSE

这个库可以将给定的图像作为ASCII字符串打印到cli。

1. 使用方法

use Ixnode\PhpCliImage\CliImage;

1.1 简单示例

$file = new File('path/to/image');
$width = 80;
$image = new CliImage($file);

print $image->getAsciiString($width);

2. 安装

composer require ixnode/php-cli-image
vendor/bin/php-cli-image -V
php-cli-image 0.1.0 (03-07-2023 01:17:26) - Björn Hempel <bjoern@hempel.li>

3. 命令行工具

用于快速检查给定图像的输出。

bin/console ci docs/image/world-map.png

或在你的composer项目中

vendor/bin/php-cli-image ci vendor/ixnode/php-cli-image/docs/image/world-map.png
                     ▄▄▄▄▀▄▄▄▄▄▄▄▄▄▄
       ▄▄    ▄▄▄▄▄▄▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀                ▄▄▄▄▀▀▀▀▀▄▄▄▄▄▄▄▄▄▄
  ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀   ▀▀          ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
       ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀           ▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ ▀▀
     ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀            ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
     ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀               ▀▀▀▀▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
     ▀▀▀▀▀▀▀▀▀▀▀▀                 ▀▀▀▀▀▀▀▀▀▀▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
      ▀▀▀▀▀▀▄▄ ▀                ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
        ▀▀▀▀▀▀                  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀
           ▀▀▀▄▄▀▀▄▄▄           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀      ▀▀    ▀▀▀▀
              ▀▀▀▀▀▀▀▀▀▄         ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀            ▀▄  ▄▀▀
              ▀▀▀▀▀▀▀▀▀▀▀▄▄▄           ▀▀▀▀▀▀▀▀▀▀▀              ▀▀▀▀▀▀▀   ▀▄▄▄▄
              ▀▀▀▀▀▀▀▀▀▀▀▀▀▀            ▀▀▀▀▀▀▀▀▀                 ▀        ▀▀▀▀▄
               ▀▀▀▀▀▀▀▀▀▀▀▀             ▀▀▀▀▀▀▀▀▀▄▀▀                   ▄▀▀▀▀▀▀
                  ▀▀▀▀▀▀▀▀▀             ▀▀▀▀▀▀▀▀ ▀▀                 ▀▀▀▀▀▀▀▀▀▀▀
                  ▀▀▀▀▀▀▀                ▀▀▀▀▀▀  ▀                  ▀▀▀▀▀▀▀▀▀▀▀
                  ▀▀▀▀▀▀                  ▀▀▀                       ▀▀▀▀▀▀▀▀▀▀▀
                  ▀▀▀▀                                                     ▀
                   ▀▀▀

Services

4. 库开发

git clone git@github.com:ixnode/php-cli-image.git && cd php-cli-image
composer install
composer test

5. 许可证

此库受MIT许可证许可 - 详细信息请参阅LICENSE文件。