Skip to content

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 committed Jun 16, 2022
1 parent c089d1e commit 3aacb3d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,42 @@ Python bindings to [libheif](https://github.com/strukturag/libheif) for working
Features:
* Decoding of `8`, `10`, `12` bit HEIF images.
* Encoding of `8`, `10`, `12` bit HEIF images.
* `EXIF`, `XMP`, `IPTC` metadata support.
* `EXIF`, `XMP`, `IPTC` read & write support.
* Support of multiple images in one file, e.g **HEIC** files and `PrimaryImage` attribute.
* HEIF `native thumbnails` support.
* Adding all this features to Pillow in one line of code as a plugin.
* Includes AVIF(x264) decoder.

## Install

## Example of use as pillow plugin.
```console
python3 -m pip install pillow-heif
```

## Example of use as pillow plugin
```python3
from PIL import Image, ImageSequence
from pillow_heif import register_heif_opener

register_heif_opener()

image = Image.open('images/input.heic')
image = Image.open("images/input.heic")
for i, frame in enumerate(ImageSequence.Iterator(image)):
rotated = frame.rotate(13)
rotated.save(f'rotated_frame{i}.heic', quality=90)
rotated.save(f"rotated_frame{i}.heic", quality=90)
```

## Standalone example use
```python3
import pillow_heif

if pillow_heif.is_supported('input.heic'):
heif_file = pillow_heif.open_heif('input.heic')
if pillow_heif.is_supported("input.heic"):
heif_file = pillow_heif.open_heif("input.heic")
for img in heif_file: # you still can use it without iteration, like before.
img.scale(1024, 768) # scaling each image in file.
heif_file.add_thumbnails([768, 512, 256]) # add three new thumbnail boxes.
# default quality is probably ~77 in x265, set it a bit lower.
heif_file.save('output.heic', quality=70, save_all=False) # save_all is True by default.
heif_file.save("output.heic", quality=70, save_all=False) # save_all is True by default.
```

## More Information
Expand Down

0 comments on commit 3aacb3d

Please sign in to comment.