Im trying to convert HEIC to JPG using python. The only other answers about this topic used pyheif. I am on windows and pyheif doesn’t support windows. Any suggestions? I am currently trying to use pillow.
Advertisement
Answer
code below convert and save the picture as png format
JavaScript
x
14
14
1
from PIL import Image
2
import pillow_heif
3
4
heif_file = pillow_heif.read_heif("HEIC_file.HEIC")
5
image = Image.frombytes(
6
heif_file.mode,
7
heif_file.size,
8
heif_file.data,
9
"raw",
10
11
)
12
13
image.save("./picture_name.png", format("png"))
14