Skip to content
pubscout

blurhash_dart

1.2.1, released 4 years ago by einval.de

A pure Dart implementation of the BlurHash algorithm for encoding and decoding images.

WASM-ready
$ flutter pub add blurhash_dart
Source repository

What it does

It encodes raw images into compact BlurHash string representations and decodes BlurHash strings back into placeholder images. It also provides utility extensions for computations like color averages.

AI-written summary of version 1.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display low-resolution placeholder gradients while full images load.
  • You want to generate BlurHash strings from images on any Dart platform without platform-specific code.

Skip it when

  • You are looking for a complete image loading and caching library.
  • You need native UI widgets specifically designed for displaying blurhashes.

Strengths

  • Pure Dart implementation supporting all Dart platforms.
  • Provides both encoder and decoder out of the box.

Weaknesses

  • Decoding returns raw pixels via the 'image' package, requiring manual conversion to displayable formats in Flutter.
  • Computationally intensive tasks like encoding should be cached to avoid running on every build.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:blurhash_dart/blurhash_dart.dart';
import 'package:image/image.dart' as img;

const hash = 'LEHV6nWB2yk8pyo0adR*.7kCMdnj';
BlurHash blurHash = BlurHash.decode(hash);
img.Image image = blurHash.toImage(35, 20);

Alternatives

Packages that do the same job and could replace blurhash_dart.

Works with

Packages commonly used together with blurhash_dart: ones it builds on, ones built on it, and its own family.