https://github.com/m1ga/ti.blurhash
Blurhash placeholder images for Titanium
https://github.com/m1ga/ti.blurhash
blurhash titanium titanium-mobile titanium-module
Last synced: 3 months ago
JSON representation
Blurhash placeholder images for Titanium
- Host: GitHub
- URL: https://github.com/m1ga/ti.blurhash
- Owner: m1ga
- License: mit
- Created: 2021-08-27T10:36:29.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-27T10:38:06.000Z (almost 4 years ago)
- Last Synced: 2025-01-27T07:12:06.807Z (5 months ago)
- Topics: blurhash, titanium, titanium-mobile, titanium-module
- Language: Java
- Homepage:
- Size: 62.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ti.blurhash - Blurhash placeholder images for Titanium
## What is BlurHash
BlurHash is a compact representation of a placeholder for an image.
(https://blurha.sh/)This library allows you to convert an image to a simple string like `LEHV6nWB2yk8pyoJadR*.7kCMdnj` and that string into a preview image:
→ `LEHV6nWB2yk8pyoJadR*.7kCMdnj` →
You app can use those preview images instead of a white or loading spinner.
This Titanium module will use the library from https://github.com/woltapp/blurhash
## How to use it:
Currently Android only
```javascript
var win = Ti.UI.createWindow();var img = Ti.UI.createImageView({
width: 200,
height: 200,
image: require("ti.blurhash").decode({
width: 200,
height: 200,
text: "LEHV6nWB2yk8pyoJadR*.7kCMdnj"
})
})
win.add(img);
win.open();
```## Methods
* decode(width:int, height:int, punch:float, useCache:boolen)
- punch can improve the contrast; default: 1## Author
- Michael Gangolf ([@MichaelGangolf](https://twitter.com/MichaelGangolf) / [Web](http://migaweb.de))