• Stars
    star
    151
  • Rank 238,051 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python version of the BlurHash encoder

blurhash-python

This is an encoder for the BlurHash algorithm. To find out more about BlurHash, see https://github.com/woltapp/blurhash.

Installation

Install blurhash with pip

$ pip install blurhash-python

or pipenv

$ pipenv install blurhash-python

Usage

Create blurhash from image file

import blurhash

with open('image.jpg', 'rb') as image_file:
    hash = blurhash.encode(image_file, x_components=4, y_components=3)

Alternatively, scale the image to produce a faster hash, and create a blurhash from the in-memory image directly

import blurhash
from PIL import Image

with Image.open('image.jpg') as image:
  image.thumbnail(( 100, 100 ))
  hash = blurhash.encode(image, x_components=4, y_components=3)

You can also pass file name as parameter to the function

import blurhash

hash = blurhash.encode('image.jpg', x_components=4, y_components=3)

y_components and x_components parameters adjust the amount of vertical and horizontal AC components in hashed image. Both parameters must be >= 1 and <= 9.

Development

Install development requirements and package in editable mode

$ pipenv install --dev

Tests

Run test suite with pytest in virtual environment

$ pytest

Use tox to run test suite against all supported python versions

$ tox

More Repositories

1

blurhash

A very compact representation of a placeholder for an image.
C
14,860
star
2

react-blurhash

React components for blurhash
TypeScript
558
star
3

wolt_modal_sheet

This package provides a responsive modal with multiple pages, motion animation for page transitions, and scrollable content within each page.
Dart
318
star
4

wolt-python-package-cookiecutter

Cookiecutter for rapidly creating modern & high-quality Python packages
Python
238
star
5

mitmproxy-mock

A tool to mock/modify server responses easily with mitmproxy
Python
87
star
6

redux-autoloader

A higher order component for declarative data loading in React and Redux.
JavaScript
57
star
7

engineering-internship-2024

The pre-assignment for frontend / backend internship applicants
51
star
8

wolt_responsive_layout_grid

Wolt Responsive Layout Grid library introduces the Flutter implementation of Material Design's responsive layout grid. It provides a unified, multi-platform grid system that ensures consistency and visual integrity regardless of the device or operating system being used.
Dart
49
star
9

parallelpbf

OpenStreetMap PBF format multithreaded reader
Java
46
star
10

engineering-summer-intern-2023

34
star
11

magic-di

Dependency Injector with minimal boilerplate code, built-in support for FastAPI and Celery, and seamless integration to basically anything.
Python
29
star
12

arrow-detekt-rules

Kotlin
28
star
13

engineering-summer-intern-2022

The home assignment for the Wolt Engineering Summer Internships 2022
25
star
14

react-geoinput

Geolocation suggestions and coordinates with Google Maps API for React
JavaScript
20
star
15

react-router-query-params

react-router-query-params
JavaScript
19
star
16

summer2021-internship

Wolt Summer 2021 Internships - Preliminary Assignment for Engineering Positions
19
star
17

data-science-summer-intern-2021

Assignment for Data Science Summer Intern candidates 2021
18
star
18

spark-osm-datasource

Native Spark OSM PBF data source
Scala
15
star
19

summer2020

Assignment for engineering intern positions
14
star
20

data-science-internship-2024

The pre-assignment for data science internship applicants
14
star
21

python-fastapi-workshop

Materials for "Modern Python APIs with FastAPI"
Python
12
star
22

celery-farmer

Python
11
star
23

react-native-assignment

React Native UI programming assignment
JavaScript
11
star
24

analytics-summer-intern-2022

Assignment for Analytics Service Summer Intern candidates for 2022
7
star
25

summer2018

Coding task
6
star
26

data-science-summer-intern-2022

6
star
27

mobile-engineering-internship-2024

The pre-assignment for mobile (Flutter) internship applicants
5
star
28

summer2019

Coding task for summer interns 2019
5
star
29

memories

Links and description of tools together with a play project for exploring memory problems
Kotlin
4
star
30

spark-osm-tools

Scala
3
star
31

junction-2022-materials

Materials for the Wolt's Junction 2022 challenge
2
star
32

looker-viz-transposed-table

2
star