Skip to content

XDwightsBeetsX/heic-image-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert those Pesky .HEIC Images to Something More Useful!

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!

Notes

  • 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

Usage

You can use this code by installing the PYPI package OR manually installing.

Package Install

  1. Download from PYPI via command line

    shell> pip install heic-image-converter
  2. 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()

Manual Install

  1. Download the repo .zip
  2. Install required packages
    shell> pip install pillow_heif
    shell> pip install pillow # (optional): can use default `PIL` (legacy)
  3. Obtain the path to the python main.py program
  4. Obtain the path to the .heic image folder
  5. Run the python script with the desired flags

if you run into usage issues, check that you have installed the requirements

Examples

  • Set the destination folder with --dest

    set custom destination folder
  • Automatically delete converted files with -del

    set delete flag

Flags

  • 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 :)