https://github.com/roipeker/as3-blurhash
blurhash encoder/decoder implementation for ActionScript 3.0
https://github.com/roipeker/as3-blurhash
Last synced: about 1 month ago
JSON representation
blurhash encoder/decoder implementation for ActionScript 3.0
- Host: GitHub
- URL: https://github.com/roipeker/as3-blurhash
- Owner: roipeker
- License: gpl-3.0
- Created: 2020-07-03T05:23:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-03T13:35:09.000Z (over 5 years ago)
- Last Synced: 2024-05-06T10:35:52.723Z (over 1 year ago)
- Language: ActionScript
- Size: 37.1 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actionscript3 - BlurHash - A BlurHash encoder/decoder implementation in ActionScript 3.0.. (Multimedia)
README
# BlurHash for ActionScript 3.0.
is a [BlurHash](https://blurha.sh) 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
```actionscript
//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
```actionscript
//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](LICENSE).