pi-heif-1.3.0
توضیحات
Python interface for libheif library
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | pi-heif-1.3.0 |
| نام | pi-heif |
| نسخه کتابخانه | 1.3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Alexander Piskun |
| ایمیل نویسنده | bigcat88@users.noreply.github.com |
| آدرس صفحه اصلی | https://github.com/bigcat88/pillow_heif |
| آدرس اینترنتی | https://pypi.org/project/pi-heif/ |
| مجوز | BSD-3-Clause |
# pi-heif
[](https://github.com/bigcat88/pillow_heif/actions/workflows/analysis-coverage.yml)



[](https://pepy.tech/project/pi-heif)
[](https://pepy.tech/project/pi-heif)





This is a light version of [Pillow-Heif](https://github.com/bigcat88/pillow_heif) with more permissive license for binary wheels.
It includes only `HEIF` decoder and does not support `save` operations.
All codebase are the same, refer to [pillow-heif docs](https://pillow-heif.readthedocs.io/).
The only difference is the name of the imported project.
### Install
```console
python3 -m pip install -U pip
python3 -m pip install pi-heif
```
### Example of use as a Pillow plugin
```python3
from PIL import Image
from pi_heif import register_heif_opener
register_heif_opener()
im = Image.open("images/input.heic") # do whatever need with a Pillow image
im.show()
```
### 8/10/12 bit HEIF to 8/16 bit PNG using OpenCV
```python3
import numpy as np
import cv2
import pi_heif
heif_file = pi_heif.open_heif("image.heic", convert_hdr_to_8bit=False, bgr_mode=True)
np_array = np.asarray(heif_file)
cv2.imwrite("image.png", np_array)
```
### Get decoded image data as a Numpy array
```python3
import numpy as np
import pi_heif
if pi_heif.is_supported("input.heic"):
heif_file = pi_heif.open_heif("input.heic")
np_array = np.asarray(heif_file)
```
### Accessing Depth Images
```python3
from PIL import Image
from pillow_heif import register_heif_opener
import numpy as np
register_heif_opener()
im = Image.open("../tests/images/heif_other/pug.heic")
if im.info["depth_images"]:
depth_im = im.info["depth_images"][0] # Access the first depth image (usually there will be only one).
# Depth images are instances of `class HeifDepthImage(BaseImage)`,
# so work with them as you would with any usual image in pillow_heif.
# Depending on what you need the depth image for, you can convert it to a NumPy array or convert it to a Pillow image.
pil_im = depth_im.to_pillow()
np_im = np.asarray(depth_im)
print(pil_im)
print(pil_im.info["metadata"])
```
### Wheels
| **_Wheels table_** | macOS<br/>Intel | macOS<br/>Silicon | Windows<br/> | musllinux* | manylinux* |
|--------------------|:---------------:|:-----------------:|:------------:|:----------:|:----------:|
| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.11 | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.12 | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.13 | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.14 | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.14t | ✅ | ✅ | ✅ | ✅ | ✅ |
| PyPy 3.11 v7.3 | ✅ | ✅ | ✅ | N/A | ✅ |
* **x86_64**, **aarch64** wheels.
نیازمندی
| مقدار | نام |
|---|---|
| - | pillow>=11.1.0 |
| xtr | pytest; |
| xtr | defusedxml; |
| xtr | packaging; |
| xtr | pytest; |
| xtr | defusedxml; |
| xtr | packaging; |
| xtr | numpy; |
| xtr | pympler; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.9 | Python |
نحوه نصب
نصب پکیج whl pi-heif-1.3.0:
pip install pi-heif-1.3.0.whl
نصب پکیج tar.gz pi-heif-1.3.0:
pip install pi-heif-1.3.0.tar.gz