Python Imaging Library
Python Imaging Library(略称 PIL)は、プログラミング言語Pythonに、各種形式の画像ファイルの読み込み・操作・保存を行う�…
| 作者 | Fredrik Lundh |
|---|---|
| 開発元 | Secret Labs AB |
| 初版 | 1995年[1] |
| 最新版 |
1.1.7
/ 2009年11月15日[3] |
| 最新評価版 |
1.2a0[2]
/ 2011年9月17日 |
| プログラミング 言語 | Python, C |
| 種別 | 画像処理向けライブラリ |
| ライセンス | Python Imaging Library license[1] |
| 公式サイト |
www |
Python Imaging Library(略称 PIL)は、プログラミング言語Pythonに、各種形式の画像ファイルの読み込み・操作・保存を行う機能を提供するフリーのライブラリである。Windows、Mac OS X、Linuxで利用することができる。2009年9月にリリースされた最新版のPIL 1.1.7では、Python 1.5-2.7をサポートしているが、Python 3のサポートは「後に」なるとされている[3]。
開発は、2011年のPILレポジトリへのコミットを最後に停止しているとみられる[2]。そのため、Pillowという後継のプロジェクトがPILのリポジトリをフォークし、Python 3のサポートなどを追加している[4]。
Pillowは、オリジナルのPILの後継として、Debian[5]やUbuntu[6](13.04から)などのLinuxディストリビューションで採用されている。
機能
PIL は、画像操作のための標準的なプロシージャを提供しており、次のようなものがある。
- ピクセル毎の操作
- マスキングと透明度の制御
- ぼかし、輪郭補正、スムージング、輪郭検出などの画像フィルタ
- シャープ化、明るさ補正、コントラスト補正、色補正などの画像の調整
- 画像へのテキストの追加
- その他いろいろ
サポートするファイル形式
PPM, PNG, JPEG, GIF, TIFF, BMPなどの画像形式をサポートしている。デコーダを新規に作成して、他の形式を読み込めるようにライブラリを拡張することもできる[7]。
使用例
この例では、ハードドライブから画像をロードし、ぼかしのフィルタ処理を行っている。
from PIL import Image, ImageFilter
original = Image.open("lena.ppm") # ハードドライブから画像をロード
blurred = original.filter(ImageFilter.BLUR) # 画像をぼかす
original.show() # 2つの画像を表示する
blurred.show()
脚注
- ^ a b “Software License”. Secret Labs AB. 2013年12月8日閲覧。
- ^ a b “effbot / pil-2009-raclette”. 2013年12月8日閲覧。
- ^ a b “Python Imaging Library”. Secret Labs AB. 2013年12月8日閲覧。
- ^ “Pillow: a modern fork of PIL”. 2013年12月8日閲覧。
- ^ “Details of package python-imaging in sid”. packages.debian.org. Software in the Public Interest. 2013年12月8日閲覧。
- ^ “Details of package python-imaging in raring”. ubuntu.com. Canonical Ltd.. 2013年12月8日閲覧。
- ^ “D. Writing Your Own File Decoder”. Effbot.org. 2014年1月28日閲覧。
外部リンク
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.