php-blurhash:Blurhash 的纯 PHP 实现(https

时间:2024-08-24 20:26:53
【文件属性】:

文件名称:php-blurhash:Blurhash 的纯 PHP 实现(https

文件大小:413KB

文件格式:ZIP

更新时间:2024-08-24 20:26:53

blurhash PHP

php-blurhash 纯 PHP 实现。 API 是稳定的,但任一方向的散列函数可能都不稳定。 Blurhash 是由为编写的算法,可将图像编码为短(~20-30 字节)ASCII 字符串。 当您将字符串解码回图像时,您将获得代表原始图像的渐变颜色。 这对于在加载前需要图像占位符的场景非常有用,甚至可以像审查图像的内容。 安装 $ composer require kornrunner/blurhash 用法 将图像编码为 blurhash 需要图像像素颜色的二维数组,示例代码: <?php require_once 'vendor/autoload.php' ; use kornrunner\ Blurhash \ Blurhash ; $ file = 'test/data/img1.jpg' ; $ image = imagecreatefromstring ( fil


【文件预览】:
php-blurhash-master
----composer.json(986B)
----composer.lock(132KB)
----.github()
--------workflows()
----test()
--------ACTest.php(587B)
--------BlurhashTest.php(3KB)
--------data()
--------DCTest.php(651B)
--------Base83Test.php(3KB)
----travis.php.ini(18B)
----LICENSE(1KB)
----appveyor.yml(2KB)
----src()
--------AC.php(1KB)
--------Base83.php(1KB)
--------Color.php(606B)
--------DC.php(604B)
--------Blurhash.php(5KB)
----psalm.xml(2KB)
----.coveralls.yml(96B)
----.gitignore(317B)
----phpstan.neon.dist(51B)
----phpunit.xml.dist(922B)
----README.md(3KB)
----infection.json.dist(201B)

网友评论