blurhash
Version, currently 0.1.02 versions
- 0.1.1latestMar 4, 2024
- 0.1.0not indexedMar 4, 2024
github.com/Sija/blurhash.cr
A pure Crystal implementation of BlurHash algorithm
27 stars
0 dependents
License: MIT
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
blurhash:
github: Sija/blurhash.cr
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# blurhash.cr [](https://github.com/Sija/blurhash.cr/actions/workflows/ci.yml) [](https://github.com/Sija/blurhash.cr/releases) [](https://github.com/Sija/blurhash.cr/blob/master/LICENSE)
A pure Crystal implementation of [Blurhash](https://github.com/woltapp/blurhash). The API is stable, however the hashing function in either direction may not be.
Blurhash is an algorithm written by [Dag Ågren](https://github.com/DagAgren) for [Wolt (woltapp/blurhash)](https://github.com/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](https://blog.joinmastodon.org/2019/05/improving-support-for-adult-content-on-mastodon/).
Currently supports `PNG` and `JPEG` file types.
## Installation
### Library
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
blurhash:
github: Sija/blurhash.cr
```
2. Run `shards install`
### CLI
1. Run `shards build --release`
## Usage
### Library
```crystal
require "blurhash"
puts Blurhash.encode(
x_components: 4,
y_components: 3,
path: Path["foo.png"]
)
```
### CLI
```console
$ ./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
- [Sijawusz Pur Rahnama](https://github.com/Sija) - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Mar 4, 2024
- Commit
9d0fb21f1e16- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/Sija/blurhash.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 2