- Notifications
You must be signed in to change notification settings - Fork73
Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium.
License
fluttercommunity/flutter_blurhash
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Blurhash is compact representation of a blurred image.It's often used as a placeholder while waiting for a full image to load.
This package implements the blurhash-decoding algorithm in pure Dart.It also provides theBlurHash widget that displays the blurhash and can transition into the actual image once it is loaded.
Currently, it doesn't support encoding an image into a blurhash.
A fast and easy way to get a blurhash for your image is to upload it tohttps://blurha.sh.
Constrain your widget's render area and let BlurHash fill the pixels.
classExampleAppextendsStatelessWidget {constExampleApp({super.key});@overrideWidgetbuild(BuildContext context) {returnMaterialApp( home:Scaffold( appBar:AppBar(title:constText("BlurHash")), body:constSizedBox.expand( child:Center( child:AspectRatio( aspectRatio:1.6, child:BlurHash(hash:"L5H2EC=PM+yV0g-mq.wG9c010J}I"), ), ), ), ), ); }}
- None (
BlurHashOptimizationMode.none): The original algorithm, provided for backward compatibility. - Standard (
BlurHashOptimizationMode.standard): Optimized decoding with better cache locality and performance. - Approximation (
BlurHashOptimizationMode.approximation): Fastest mode with an approximated sRGB conversion that produces slightly darker results but significantly improves performance.
classBlurHashAppextendsStatelessWidget {constBlurHashApp({Key? key}):super(key: key);@overrideWidgetbuild(BuildContext context)=>MaterialApp( home:Scaffold( appBar:AppBar(title:constText("BlurHash")), body:constSizedBox.expand( child:Center( child:AspectRatio( aspectRatio:1.6, child:BlurHash( hash:"L5H2EC=PM+yV0g-mq.wG9c010J}I", optimizationMode:BlurHashOptimizationMode.approximation, ), ), ), ), ), );}
About
Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors12
Uh oh!
There was an error while loading.Please reload this page.
