承接 eislambey/splathash-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eislambey/splathash-php

最新稳定版本:1.0.0

Composer 安装命令:

composer require eislambey/splathash-php

包简介

16 bytes fixed size image placeholder, an alternative to blurhash and thumbhash

README 文档

README

PHP port of SplatHash: compress any image to exactly 16 bytes and reconstruct a 32x32 RGBA placeholder.

Requirements

  • PHP 8.2+
  • ext-gd for SplatHash::encode() from image files or GdImage

Install

composer require eislambey/splathash-php

Usage

<?php

use Islambey\SplathashPhp\SplatHash;

require __DIR__ . '/vendor/autoload.php';

$hash = SplatHash::encode('photo.jpg');      // 16 raw bytes
$string = SplatHash::toBase64Url($hash);     // 22-char base64url string

$sameHash = SplatHash::fromBase64Url($string);
$rgba = SplatHash::decode($sameHash);        // 32 * 32 * 4 raw RGBA bytes

For already decoded pixels:

$hash = SplatHash::encodeRaw($rgbaBytes, $width, $height);

API

  • SplatHash::encode(string|GdImage $source): string
  • SplatHash::encodeRaw(string $rgba, int $width, int $height): string
  • SplatHash::decode(string $hash): string
  • SplatHash::toBase64Url(string $hash): string
  • SplatHash::fromBase64Url(string $value): string

Development

composer install
php tests/run.php

License

MIT

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固