technodelight / php-cli-iterm-image-renderer
Render images with PHP in your iterm2 console
1.0
2019-07-03 12:27 UTC
Requires
- technodelight/shell-exec: ^1.0
This package is auto-updated.
Last update: 2024-11-29 05:51:09 UTC
README
Render images with PHP in your iterm2 console
usage
#!/usr/bin/env php
<?php
use Technodelight\ITermImage\Image;
$image = Image::fromUri('https://picsum.photos/200', 200);
if (!empty($image)) {
echo $image;
}
Running the above script will render a random picsum image in your terminal, 200 px wide.
requirements
This library was built to work with the famous iTerm2 OS X application. It has a basic fallback version to render the URI instead of the image, if the current iTerm does not support displaying images (or you're not using iTerm2 at all).