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

Pyheif: https://pypi.org/project/pyheif/
Pillow: https://pillow.readthedocs.io/en/latest/index.html

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

Link: https://www.jetsoncreative.com/mac-dynamic-desktop-store/earth-mac

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 heic_export.py [note: change out the image file name if you try a different file]

Have fun