Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/natlee/heic2png
Convert format of HEIC image to PNG by using Python.
https://github.com/natlee/heic2png
cli format heic heif heif-converter image-convert image-converter image-format image-processing ios-camera png tool
Last synced: 2 months ago
JSON representation
Convert format of HEIC image to PNG by using Python.
- Host: GitHub
- URL: https://github.com/natlee/heic2png
- Owner: NatLee
- License: mit
- Created: 2022-09-01T14:45:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T03:46:24.000Z (about 1 year ago)
- Last Synced: 2024-03-25T07:20:53.891Z (10 months ago)
- Topics: cli, format, heic, heif, heif-converter, image-convert, image-converter, image-format, image-processing, ios-camera, png, tool
- Language: Python
- Homepage: https://pypi.org/project/HEIC2PNG/
- Size: 32.2 KB
- Stars: 21
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HEIC2PNG
[![Test](https://github.com/NatLee/HEIC2PNG/actions/workflows/test.yml/badge.svg)](https://github.com/NatLee/HEIC2PNG/actions/workflows/test.yml)
[![Release](https://github.com/NatLee/HEIC2PNG/actions/workflows/release.yml/badge.svg)](https://github.com/NatLee/HEIC2PNG/actions/workflows/release.yml)This is a tool for converting the format of HEIC images to PNG using Python. It now supports quality adjustment and has an option to overwrite existing files, enhancing the flexibility and usability of the tool.
## Installation
```bash
pip install heic2png
```Visit [HEIC2PNG on PyPI](https://pypi.org/project/HEIC2PNG/) for more details.
## Usage
### As a Library
You can use HEIC2PNG in your Python code as shown below:
```python
from heic2png import HEIC2PNGif __name__ == '__main__':
heic_img = HEIC2PNG('test.heic', quality=90) # Specify the quality of the converted image
heic_img.save() # The converted image will be saved as `test.png`
```### Command Line Interface
HEIC2PNG also provides a CLI for easy conversion of HEIC images to PNG. Here are some examples:
Convert a HEIC image to PNG with a specified output path:
```bash
heic2png -i test.heic -o test.png -q 90 # -q is used to specify the quality
```If you want to keep the original name, use the command below. It will generate `test.png` for you:
```bash
heic2png -i test.heic -q 90
```To overwrite an existing PNG file, use the `-w`` flag:
```bash
heic2png -i test.heic -o test.png -q 90 -w
```
## References- [Example PyPi Package](https://github.com/tomchen/example_pypi_package)
- [Pillow HEIF](https://github.com/bigcat88/pillow_heif)
- [pngquant](https://pngquant.org/)