Python用モジュール「Pillow」で画像を読み込んで表示する方法についてソースコード付きでまとめました。
画像の読み込みと表示
Pythonの標準モジュール「Pillow」を用いて、画像を読み込んで表示します。
サンプルコード(Python3)
サンプルプログラムのソースコードです。
# -*- coding:utf-8 -*- from PIL import Image # 入力画像の読み込み img = Image.open("input.jpg") # 規定のソフトで画像を閲覧 img.show()
– | 関連記事 |
---|---|
1 | ■【Python/Pillow】画像処理入門 |
2 | ■Python入門 基本文法 |
コメント