Skip to content

Commit 7eef332

Browse files
committed
[update] add new flag -q in README
1 parent 2776351 commit 7eef332

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

README.md

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,55 @@
11
# HEIC2PNG
22

3-
[![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)
3+
[![Test](https://github.com/NatLee/HEIC2PNG/actions/workflows/test.yml/badge.svg)](https://github.com/NatLee/HEIC2PNG/actions/workflows/test.yml)
4+
[![Release](https://github.com/NatLee/HEIC2PNG/actions/workflows/release.yml/badge.svg)](https://github.com/NatLee/HEIC2PNG/actions/workflows/release.yml)
45

5-
This is a tool for converting format of HEIC image to PNG by using Python.
6-
7-
And it can be used with simple CLI mode.
8-
9-
I used the pypi package template to generate this repo, you can check it in the [references](#References).
6+
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.
107

118
## Installation
129

1310
```bash
1411
pip install heic2png
1512
```
1613

17-
You can visit it on https://pypi.org/project/HEIC2PNG/ .
14+
Visit [HEIC2PNG on PyPI](https://pypi.org/project/HEIC2PNG/) for more details.
1815

1916
## Usage
2017

21-
Common use with code below.
18+
### As a Library
19+
20+
You can use HEIC2PNG in your Python code as shown below:
2221

2322
```python
2423
from heic2png import HEIC2PNG
2524

2625
if __name__ == '__main__':
27-
heic_img = HEIC2PNG('test.heic')
28-
heic_img.save() # it'll show as `test.png`
29-
26+
heic_img = HEIC2PNG('test.heic', quality=90) # Specify the quality of the converted image
27+
heic_img.save() # The converted image will be saved as `test.png`
3028
```
3129

32-
And, you can try CLI with this.
30+
### Command Line Interface
31+
32+
HEIC2PNG also provides a CLI for easy conversion of HEIC images to PNG. Here are some examples:
33+
34+
Convert a HEIC image to PNG with a specified output path:
3335

3436
```bash
35-
heic2png --input_path test.heic --output_path test.png
37+
heic2png -i test.heic -o test.png -q 90 # -q is used to specify the quality
3638
```
3739

38-
Or, you want to keep original name, just use this.
40+
If you want to keep the original name, use the command below. It will generate `test.png` for you:
3941

4042
```bash
41-
heic2png --input_path test.heic
43+
heic2png -i test.heic -q 90
4244
```
4345

44-
It'll generate `test.png` for you.
46+
To overwrite an existing PNG file, use the `-w`` flag:
4547

48+
```bash
49+
heic2png -i test.heic -o test.png -q 90 -w
50+
```
4651
## References
4752

4853
- [Example PyPi Package](https://github.com/tomchen/example_pypi_package)
4954
- [Pillow HEIF](https://github.com/bigcat88/pillow_heif)
55+
- [pngquant](https://pngquant.org/)

0 commit comments

Comments
 (0)