Skip to content

A Blurhash implementation in the Godot Game Engine

License

Notifications You must be signed in to change notification settings

TheLsbt/GodotBlurhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Godot Blurhash

A Blurhash implementation in the Godot Game Engine.

Decode a image from a blurhash

var hash: String = "LU9Rquj[H;fQRjfQoffQH;ayx^fQ"

# blurhash, width, height, punch
var decoded_texture: Texture = Blurhash.decode(hash, 128, 128, 1.0)

# texture_rect is reference to a TextureRect node in the scene
texture_rect.texture = decoded_texture 

Encode a blurhash icon.svg

 var texture: Texture2d = preload("res://icon.svg")
 var hash: String = Blurhash.encode(texture, 4, 3) #LU9Rquj[H;fQRjfQoffQH;ayx^fQ
 print(hash)

Note!
As per the original implementation it is suggested to only decode to a relatively small size and then scale the result up, as it basically looks the same anyways.

Licence

This repository is under the MIT licence.

About

A Blurhash implementation in the Godot Game Engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published