Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A high performance implementation of blurhash for Compose Multiplatform. Utilizes SKSL shaders for performant rendering.

License

Notifications You must be signed in to change notification settings

brys0/compose-blurhash

Repository files navigation

Compose blurhash

Provides multiplatform library to use blurhash in your compose app.
Using SKSL/AGSL for the best possible performance compared to regular bitmap alternatives.

What platforms are currently supported

  • WasmJS/Browser
  • Desktop/JVM
  • iOS/Apple
  • Android

Usage

Add this to your build.gradle.kts

implementation("io.github.brys0:blurhash:0.0-4-ALPHA")

You can now use it like this

@Composable
fun MyComposable() {
    BlurHashImage(
        "URGtW@NM}FV?w7={wOi{xYi%s,sm-CNZnPxt", // Your blurhash string 
        modifier = Modifier.fillMaxSize() // Modifiers you would like to apply
    )
}

Project Structure

This project contains several modules each for a different purpose.

  1. blurhash - Contains the public code for implementing in your project
  2. blurhash-skio - Contains the code specific to skia related implementations (WasmJS/Desktop/iOS)
  3. blurhash-shader - Contains the shader related code and processing
  4. sample - Contains a super simple sample project to demo the functionality

Accreditation

  • peerless2012 For personally helping me get this project adapted over to compose and for his blurhash implementation for android
  • blurha For providing a reference on implementation, as well as creating a very simplistic and elegant solution to placeholder images
  • shady For providing a reference on how to implement shader based code into compose specifically
  • blurhash_shader For providing the initial shader code to base sksl shader code off of
  • Romain Guy For providing a fast and performant color calculation for blurhash strings

About

A high performance implementation of blurhash for Compose Multiplatform. Utilizes SKSL shaders for performant rendering.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5