Skip to main content

Python bindings for libavif

Project description

PyPI version Supported Python versions Build status

Python bindings for libavif (via CFFI)

Installation from PyPI

avif is available via PyPI, with wheels built for many common platforms. It can be installed via your favorite Python package manager, e.g.:

$ pip install avif

Or if you want to use Pillow integration:

$ pip install avif[pillow]

Installation from source

To install this module from source you will need to compile libavif yourself. If you want to make use of the decoder you will also need to compile one (decoders/encoders can be compiled from libavif).

List of available AV1 decoders:

If you compile avif without an AV1 decoder you will get AVIFError: No codec available raised when you try to get a result, but you will still be able to import python module.

The installation steps below show how to compile libavif with the aom decoder.

Platform-Specific Steps

Examples

Examples can be found under examples directory.

You can use sample.avif if you don’t have any avif encoded image for testing. Sample is 128x128 pixels in size and it’s all white (RGBA: 255, 255, 255, 255).

To test if library works properly you can run:

$ python examples/avif_example_decode_file.py examples/sample.avif

Correct output:

Parsed AVIF: 128x128 (8bpc)
* First pixel: RGBA(255, 255, 255, 255)

Or to test Pillow plugin:

$ python examples/avif_example_pillow_decode_file.py examples/sample.avif

Correct output:

Parsed AVIF: 128x128 (Mode: RGBA)
* First pixel: RGBA(255, 255, 255, 255)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avif-0.5.0.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distributions

avif-0.5.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl (57.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

avif-0.5.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (8.5 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

avif-0.5.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl (57.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

avif-0.5.0-pp36-pypy36_pp73-macosx_10_9_x86_64.whl (8.5 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

avif-0.5.0-pp27-pypy_73-manylinux2010_x86_64.whl (57.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

avif-0.5.0-pp27-pypy_73-macosx_10_9_x86_64.whl (8.4 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

avif-0.5.0-cp39-cp39-manylinux2010_x86_64.whl (80.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

avif-0.5.0-cp39-cp39-manylinux2010_i686.whl (79.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

avif-0.5.0-cp39-cp39-manylinux1_x86_64.whl (80.3 kB view hashes)

Uploaded CPython 3.9

avif-0.5.0-cp39-cp39-manylinux1_i686.whl (79.0 kB view hashes)

Uploaded CPython 3.9

avif-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl (11.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

avif-0.5.0-cp38-cp38-manylinux2010_x86_64.whl (80.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

avif-0.5.0-cp38-cp38-manylinux2010_i686.whl (79.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

avif-0.5.0-cp38-cp38-manylinux1_x86_64.whl (80.7 kB view hashes)

Uploaded CPython 3.8

avif-0.5.0-cp38-cp38-manylinux1_i686.whl (79.3 kB view hashes)

Uploaded CPython 3.8

avif-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl (11.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

avif-0.5.0-cp37-cp37m-manylinux2010_x86_64.whl (80.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

avif-0.5.0-cp37-cp37m-manylinux2010_i686.whl (78.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

avif-0.5.0-cp37-cp37m-manylinux1_x86_64.whl (80.1 kB view hashes)

Uploaded CPython 3.7m

avif-0.5.0-cp37-cp37m-manylinux1_i686.whl (78.8 kB view hashes)

Uploaded CPython 3.7m

avif-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl (11.7 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

avif-0.5.0-cp36-cp36m-manylinux2010_x86_64.whl (80.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

avif-0.5.0-cp36-cp36m-manylinux2010_i686.whl (78.8 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

avif-0.5.0-cp36-cp36m-manylinux1_x86_64.whl (80.1 kB view hashes)

Uploaded CPython 3.6m

avif-0.5.0-cp36-cp36m-manylinux1_i686.whl (78.8 kB view hashes)

Uploaded CPython 3.6m

avif-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl (11.7 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

avif-0.5.0-cp35-cp35m-manylinux2010_x86_64.whl (80.5 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

avif-0.5.0-cp35-cp35m-manylinux2010_i686.whl (79.2 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ i686

avif-0.5.0-cp35-cp35m-manylinux1_x86_64.whl (80.5 kB view hashes)

Uploaded CPython 3.5m

avif-0.5.0-cp35-cp35m-manylinux1_i686.whl (79.2 kB view hashes)

Uploaded CPython 3.5m

avif-0.5.0-cp35-cp35m-macosx_10_9_x86_64.whl (11.7 kB view hashes)

Uploaded CPython 3.5m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page