Utility: Pagination and Blurhash

Blurhash decoding

This function allows for easy basic decoding of blurhash strings to images. This requires Mastodon.pys optional “blurhash” feature dependencies.

Mastodon.decode_blurhash(media_dict, out_size=(16, 16), size_per_component=True, return_linear=True)[source]

Basic media-dict blurhash decoding.

out_size is the desired result size in pixels, either absolute or per blurhash component (this is the default).

By default, this function will return the image as linear RGB, ready for further scaling operations. If you want to display the image directly, set return_linear to False.

Returns the decoded blurhash image as a three-dimensional list: [height][width][3], with the last dimension being RGB colours.

For further info and tips for advanced usage, refer to the documentation for the blurhash module: https://github.com/halcy/blurhash-python