whatthejeff / drawille
Terminal drawing with braille
Installs: 853
Dependents: 0
Suggesters: 0
Security: 0
Stars: 101
Watchers: 7
Forks: 2
Open Issues: 0
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: 4.1.*
This package is not auto-updated.
Last update: 2024-11-09 16:27:14 UTC
README
Terminal drawing with braille.
Requirements
php-drawille requires PHP 5.4.0 or later.
Installation
The recommended way to install php-drawille is through
composer. Just create a composer.json
file and
run the php composer.phar install
command to install it:
{ "require": { "whatthejeff/drawille": "~1.0" } }
Usage
use Drawille\Canvas; $canvas = new Canvas(); for($x = 0; $x <= 1800; $x += 10) { $canvas->set($x / 10, 10 + sin($x * M_PI / 180) * 10); } echo $canvas->frame(), "\n";
use Drawille\Turtle; $turtle = new Turtle(); for($x = 0; $x < 36; $x++) { $turtle->right(10); for($y = 0; $y < 36; $y++) { $turtle->right(10); $turtle->forward(8); } } echo $turtle->frame(), "\n";
Examples
To use the scripts in the examples directory, you need to install the dependencies with composer.
$ cd examples
$ php composer.phar install
$ ./img2term.php --fab --threshold 600 ~/Pictures/sb.png
Tests
To run the test suite, you need composer.
$ php composer.phar install
$ vendor/bin/phpunit
Acknowledgements
php-drawille is a port of drawille.
License
php-drawille is licensed under the MIT license.