moroz1999 / sxg
SXG 转换/生成工具(PHP版)
1.0.3
2018-02-19 22:14 UTC
Requires
- php: >=5.6.0
README
该仓库包含用于在PHP中生成SXG图像所需的工具。
使用示例
$gd = imagecreatefromjpeg('boobs.jpg'); include_once('src/Sxg/Image.php'); $image = new Sxg\Image(); $image->setWidth(320); $image->setHeight(240); $array = [ 0x000fff, 0xff00ff, 0x000000, 0xff0000, 0xffff00, 0xffffff, 0xf0ff30, 0x808080, 0x80f080, 0xcdcdcd, 0xf7cdb4, 0x432118, 0xb58169, ]; $image->setColorFormat($image::SXG_COLOR_FORMAT_16); $image->setRgbPalette($array); $image->setPaletteType($image::SXG_PALETTE_FORMAT_CLUT); $image->importFromGd($gd); file_put_contents('test.sxg', $image->getSxgData());
安装
Composer
{ "require": { "moroz1999/sxg": "*" } }
链接
- "SXG 格式描述" - 俄语
- "ZX Evolution上的TS-Config视频模式和架构" - 俄语
许可证
Creative Commons Zero v1.0 Universal