Skip to content

blurhash encoder/decoder implementation for ActionScript 3.0

License

Notifications You must be signed in to change notification settings

leossmith/as3-blurhash-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlurHash for ActionScript 3.0.

is a BlurHash encoder/decoder implementation in ActionScript 3.0.

Based on https://blurha.sh/

Check Main.as for usage samples.

How to use it

Example usage of decoder:

Usage in pure AS3

//Image hash to be decoded
var hashed:String = 'LKO2?U%2Tw=w]~RBVZRi};RPxuwH';
//Image placeholder
var img:Sprite = new Sprite();
addChild(img);
//Load image from hash
var blurImage:Bitmap = ImageUtils.getBitmapFromHash(hashed, tw, th, 1, 32);
img.addChild(blurImage);

Usage in Apache Flex

//Image hash to be decoded
var hashString:String = 'LKO2?U%2Tw=w]~RBVZRi};RPxuwH';
//Container can be any UI Element used as placehodler (ex. Group)
var decodedBitmap:Bitmap = ImageUtils.getBitmapFromHash(hashString, container.width, container.height, 1, 32);
myImgComponent.source = decodedBitmap.bitmapData;
//Enable smooth in Image or BitmapImage for best result
myImgComponent.smooth=true;

Contributing

Issues, feature requests or improvements welcome!

Licence

This project is licensed under the GPL-3.0 License.

About

blurhash encoder/decoder implementation for ActionScript 3.0

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • ActionScript 100.0%