An open API service indexing awesome lists of open source software.

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

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))

Buy Me A Coke donate button