Messing around with HEIC files in Python

What the heck are HEIC files?

HIEC files as a newer type of image format that can contain a bunch of images inside a container. I was trying to extract the internal files individually with Apple Preview, but ended up writing a quick and dirty Python script to do it for me.

I am using pyheif to extract the byte data and Pillow to write the files


I grabbed the "Earth from ISS Mixed" view of Earth from the ISS from as I liked the images.


sized down from 5k to JPG for slow internet users

To run the script, you need to setup a virtualenv, pip install the requirements and then run the Python file: python [note: change out the image file name if you try a different file]

Have fun