Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ixnode/php-cli-image
This library converts a given image to ASCII string
https://github.com/ixnode/php-cli-image
Last synced: 10 days ago
JSON representation
This library converts a given image to ASCII string
- Host: GitHub
- URL: https://github.com/ixnode/php-cli-image
- Owner: ixnode
- License: mit
- Created: 2023-08-13T23:15:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-20T21:20:34.000Z (12 months ago)
- Last Synced: 2024-05-22T02:00:49.570Z (6 months ago)
- Language: PHP
- Size: 66.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Cli Image
[![Release](https://img.shields.io/github/v/release/ixnode/php-cli-image)](https://github.com/ixnode/php-cli-image/releases)
[![](https://img.shields.io/github/release-date/ixnode/php-cli-image)](https://github.com/ixnode/php-cli-image/releases)
![](https://img.shields.io/github/repo-size/ixnode/php-cli-image.svg)
[![PHP](https://img.shields.io/badge/PHP-^8.2-777bb3.svg?logo=php&logoColor=white&labelColor=555555&style=flat)](https://www.php.net/supported-versions.php)
[![PHPStan](https://img.shields.io/badge/PHPStan-Level%20Max-777bb3.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)
[![PHPUnit](https://img.shields.io/badge/PHPUnit-Unit%20Tests-6b9bd2.svg?style=flat)](https://phpunit.de)
[![PHPCS](https://img.shields.io/badge/PHPCS-PSR12-416d4e.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)
[![PHPMD](https://img.shields.io/badge/PHPMD-ALL-364a83.svg?style=flat)](https://github.com/phpmd/phpmd)
[![Rector - Instant Upgrades and Automated Refactoring](https://img.shields.io/badge/Rector-PHP%208.2-73a165.svg?style=flat)](https://github.com/rectorphp/rector)
[![LICENSE](https://img.shields.io/github/license/ixnode/php-api-version-bundle)](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE)> This library prints a given image to cli as ascii string.
## 1. Usage
```php
use Ixnode\PhpCliImage\CliImage;
```### 1.1 Simple example
```php
$file = new File('path/to/image');
$width = 80;
$image = new CliImage($file);print $image->getAsciiString($width);
```## 2. Installation
```bash
composer require ixnode/php-cli-image
``````bash
vendor/bin/php-cli-image -V
``````bash
php-cli-image 0.1.0 (03-07-2023 01:17:26) - Björn Hempel
```## 3. Command line tool
> Used to quickly check the image output of given image.
```bash
bin/console ci docs/image/world-map.png
```or within your composer project:
```bash
vendor/bin/php-cli-image ci vendor/ixnode/php-cli-image/docs/image/world-map.png
``````bash
▄▄▄▄▀▄▄▄▄▄▄▄▄▄▄
▄▄ ▄▄▄▄▄▄▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▄▄▄▄▀▀▀▀▀▄▄▄▄▄▄▄▄▄▄
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ ▀▀
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▄▄ ▀ ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▄▄▀▀▄▄▄ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀ ▀▀▀▀
▀▀▀▀▀▀▀▀▀▄ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▄ ▄▀▀
▀▀▀▀▀▀▀▀▀▀▀▄▄▄ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀ ▀▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▄
▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▄▀▀ ▄▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀ ▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀ ▀
▀▀▀
```## 4. Library development
```bash
git clone [email protected]:ixnode/php-cli-image.git && cd php-cli-image
``````bash
composer install
``````bash
composer test
```## 5. License
This library is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.