i-Device images often come in .heic
image file format, but these don't translate well to other uses...
I had a bunch of downloaded .heic
files but wanted to convert them to .png
format so I wrote this converter!
- no suitable package was found to convert
.heic
➡️.jpg
on Windows. - panoramic or stretched images may not convert properly.
- skips already-converted files to prevent redundancy
You can use this code by installing the PYPI package OR manually installing.
-
Download from PYPI via command line
shell> pip install heic-image-converter
-
Use the
heic_image_converter/Converter.py
import sys from heic_image_converter.Converter import Converter # EX: > python [path/to/convert.py](0) [path/to/sourceDir](1) --to(2) [saveAs](3) --dest(4) [path/to/saveDir](5) -del if __name__ == "__main__": ImgConverter = Converter(sys.argv[1:]) ImgConverter.convert_files()
- Download the repo
.zip
- Install required packages
shell> pip install pillow_heif shell> pip install pillow # (optional): can use default `PIL` (legacy)
- Obtain the path to the python
main.py
program - Obtain the path to the
.heic
image folder - Run the python script with the desired flags
if you run into usage issues, check that you have installed the requirements
- double-hyphen '
--
' flags take arguments - single-hyphen '
-
' flags are booleans
Flag | Options | Description |
---|---|---|
--to |
png |
sets the desired type to convert the .heic files to. |
--dest |
path/to/saveDest |
choose the save location for the converted files. |
-del |
none |
delete the original .heic file after successful conversions. |
if you have comments / suggestions / bug fixes, please make a github issue here
thanks for checking this project out :)