homelan / dec-sixel
Provides a class that produces the sixel terminal ouput needed to display a png|jepg|gif image
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.2
This package is auto-updated.
Last update: 2025-05-19 16:12:02 UTC
README
PHP Class for reading in image files, and producing the output for a terminal that supports sixel, to display that image.
Install
composer require homelan/dec-sixel
Usage
There is one class prodvided by the package, which reads in an image file, and produces the sixel escape sequence.
require_once 'vendor/autoload.php';
use HomeLan\Retro\DEC\Terminal\Gfx\SixelConverter;
// Create converter instance
$oConverter = new SixelConverter();
// Configure converter
$oConverter->setMaxDimensions(200, 300) // Set reasonable terminal size
->setColorCount(32) // Use 64 colors for better terminal compatibility
->loadImage('some-image.png');
// Convert and output
echo "Displaying image in Sixel format:\n";
echo $oConverter->convertToSixel();