https://github.com/raincal/blurhash
Compact representation of a placeholder for an image. (Flutter)
https://github.com/raincal/blurhash
blurhash flutter flutter-plugin
Last synced: 3 months ago
JSON representation
Compact representation of a placeholder for an image. (Flutter)
- Host: GitHub
- URL: https://github.com/raincal/blurhash
- Owner: Raincal
- License: mit
- Created: 2019-09-28T09:36:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T10:39:47.000Z (4 months ago)
- Last Synced: 2025-03-20T16:52:44.450Z (3 months ago)
- Topics: blurhash, flutter, flutter-plugin
- Language: Kotlin
- Homepage: https://pub.dev/packages/blurhash
- Size: 1.33 MB
- Stars: 12
- Watchers: 1
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# blurhash
[](https://pub.dartlang.org/packages/blurhash)
Compact representation of a placeholder for an image.
### Platform Support
| Android | iOS | Web |
|:-------:|:---:|:---:|
| ✔️ | ✔️ | ✔️ |
## Usage
To use this plugin, add `blurhash` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
### Example
```dart
void blurHashEncode() async {
ByteData bytes = await rootBundle.load("image.jpg");
Uint8List pixels = bytes.buffer.asUint8List();
var blurHash = await BlurHash.encode(pixels, 4, 3);
}void blurHashDecode() async {
Uint8List? imageDataBytes;
try {
imageDataBytes = await BlurHash.decode(blurhash, 20, 12);
} on PlatformException catch (e) {
throw Exception(e.message);
}
}
```