Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lengths 81 and 82 to signal extensions #1

Open
aaaaalbert opened this issue Aug 11, 2022 · 0 comments
Open

Use lengths 81 and 82 to signal extensions #1

aaaaalbert opened this issue Aug 11, 2022 · 0 comments

Comments

@aaaaalbert
Copy link
Owner

Blurhashes start with a length field. Do the math and you shall see: x and y component counts from 1 to 9 can be encoded into values 0 to 80, occupying 81 of 83 possible values a single base-83 digit can take.

Encodings of 81 and 82 yield tall-and-narrow rectangular Blurhashes. I argue that it is more useful for these values to signal extensions to the default (3-channel sRGB DCT) Blurhash format. This enables experimentation while keeping the existing useful format intact.

For decoders to skip/error out on Blurhashes extended such, just inspect the length byte and only process lengths up to 80.

The "extension indicators" of 81 and 82 might

  • be used for stable and experimental extensions, respectively
  • be followed by another type or length digit
  • (or variable lengths, see UTF-8's bag of tricks)

The functionality and semantics of the extension formats are subject to discussion: E.g., add alpha/transparency, do colorspace conversion like JPG, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant