
Python で画像を開くプロセスを紹介します。
#ツール/マテリアル
python3.6
pycharm
メソッド/手順
まず、PIL モジュールをインポートします。

次に、画像のパス変数を保存します。この例では、画像は py ファイルが配置されているディレクトリにあるため、相対パスを使用する場合は、イメージ名を使用します。

# 画像パスを通じて画像を開く image = Image.open(path)

# 画像を印刷するinformation print( image.size, image.format)

サイズを設定 image.thumbnail((100, 200))
# 画像を保存.save('3.jpg')

END
注意事項
また、画像を便利かつ迅速に処理するためのサードパーティ モジュール ピローをダウンロードすることもできます。
推奨される関連チュートリアル:
Python ビデオ チュートリアル
以上がPython の基本知識がなくても写真を開く方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。