Skip to content

m1ga/ti.blurhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

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

Buy Me A Coke donate button