Forum Discussion
Windows 10 PCでHEICをJPGに変換する一番いい方法は?
この方法では、HEIC JPG 変換 Windows 10するために、Pythonプログラミング言語とpillow_heifライブラリを使用します。これはPillow(PIL)にlibheifバックエンドを提供するものです。
手順:
ステップ1:Pythonをインストールする
インストール時に「Add Python to PATH」にチェックを入れます
ステップ2:必要なライブラリをインストールする
text
pip install pillow_heif
ステップ3:以下のPythonスクリプトを実行する
python
import os
from pillow_ heif import HeifImagePlugin
from PIL import Image
def convert heicto jpg(heic file, jpg_file):
with Image. open(heic_ file) as image:
if image. mode != "RGB":
image = image.convert("RGB")
image.save(jpg_ file, "JPEG")
print(f"Converted: {heic file} -> {jpg file}")
def convert_ allheic indirectory(directory, jpg directory):
if not os. path.exists(jpg_ directory):
os. makedirs(jpg_ directory)
for filename in os.listdir(directory):
if filename. lower().endswith(". heic"):
heic_file = os. path. join(directory, filename)
jpg_file = os. path. join(jpg_directory, os. path. splitext(filename)[0] + ". jpg")
convert heicto jpg(heic file, jpg_f ile)
if __name__ == "__ main__":
directory = r"C: \path\to\your\heic\files"
jpg_directory = r"C: \path\to\save\jpg\files"
convert_all_heic_in_directory(directory, jpg_directory)
このHEIC JPG 変換 Windows 10 方法を使ったとしても、pillow_heifライブラリは内部的にlibheifに依存しています。これはデコーダです。基本的な制約は変わりません。HEICは、何らかの助けなしにはWindowsが読み取れない形式だということです。それを「拡張機能」「デコーダ」「ライブラリ」「ドライバ」と呼ぶかどうかにかかわらず、HEIC形式をWindowsが理解できる何かに変換するものが必要です。
上記のPythonによる方法は、「従来のソフトウェア」のカテゴリには当てはまらない唯一のアプローチですが、それでもPythonとライブラリの一度だけのセットアップが必要です。