Popularity
5.6
Growing
Activity
5.7
-
22
5
2

Programming language: Crystal
License: MIT License
Tags: Algorithms And Data Structures    
Latest version: v0.1.0

blurhash.cr alternatives and similar shards

Based on the "Algorithms and Data structures" category.
Alternatively, view blurhash.cr alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of blurhash.cr or a related project?

Add another 'Algorithms and Data structures' Shard

README

blurhash.cr Build Status Releases License

A pure Crystal implementation of Blurhash. The API is stable, however the hashing function in either direction may not be.

Blurhash is an algorithm written by Dag Ågren for Wolt (woltapp/blurhash) that encodes an image into a short (~20-30 byte) ASCII string. When you decode the string back into an image, you get a gradient of colors that represent the original image. This can be useful for scenarios where you want an image placeholder before loading, or even to censor the contents of an image à la Mastodon.

Currently supports PNG and JPEG file types.

Installation

Library

  1. Add the dependency to your shard.yml:
   dependencies:
     blurhash:
       github: Sija/blurhash.cr
  1. Run shards install

CLI

  1. Run shards build --release

Usage

Library

require "blurhash"

puts Blurhash.encode(
  x_components: 4,
  y_components: 3,
  path: Path["foo.png"]
)

CLI

$ ./bin/blurhash 4 3 foo.png

Contributing

  1. Fork it (https://github.com/Sija/blurhash.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors


*Note that all licence references and agreements mentioned in the blurhash.cr README section above are relevant to that project's source code only.