Skip to main content

Convert format of HEIC image to PNG by using Python.

Project description

HEIC2PNG

Test Release

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

pip install heic2png

Visit HEIC2PNG on PyPI for more details.

Usage

As a Library

You can use HEIC2PNG in your Python code as shown below:

from heic2png import HEIC2PNG

if __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:

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:

heic2png -i test.heic -q 90

To overwrite an existing PNG file, use the `-w`` flag:

heic2png -i test.heic -o test.png -q 90 -w

References

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

HEIC2PNG-1.1.2.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

HEIC2PNG-1.1.2-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

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