Skip to content

Instantly share code, notes, and snippets.

@TonyPepeBear
Last active October 5, 2022 19:21
Show Gist options
  • Save TonyPepeBear/c9205def0a6c480e6f6fb8db6b4ccb8e to your computer and use it in GitHub Desktop.
Save TonyPepeBear/c9205def0a6c480e6f6fb8db6b4ccb8e to your computer and use it in GitHub Desktop.
jpg -> heic. Require ImageMagick in PATH
import os
heics = list(filter(lambda f : f.endswith(".heic") or f.endswith(".HEIC"), os.listdir(".")))
l = len(heics)
for i in range(l):
heic = heics[i]
print(heic + " (" + str(i+1) + "/" + str(l) + ")")
os.system("magick convert " + heic + " " + "".join(heic.split(".")[0:-1]) + ".jpg")
os.remove(heic)
input("Finish...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment