今回の演習では Python の PIL (Python Imaging Library) を利用する。
python への path が通っていることを確認しておくこと。
(通っていない場合は /pub/sol8/bin を .cshrc の path 設定のところに
追加しておく)
tkikuchi@sis04% ls tanuki.jpg
tanuki.jpg
tkikuchi@sis04% python
Python 2.2.1 (#3, May 22 2002, 15:29:49)
[GCC 2.95.3 20010315 (release)] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import Image
>>> im = Image.open("tanuki.jpg")
>>> im.show()
>>> Ctl+D コントロール+Dで終了
 | 
| open() | 画像ファイルを開き、Imageインスタンスを返す
    
  | |
| show() | 表示(実際には xv が起動される)
    
  | |
| transform(AFFINE) | アフィン変換
 書式: transform(サイズ,Image.AFFINE, 変換係数, 内挿法) サイズ:(x,y)2つの整数によるタプル 変換係数:(a,b,c,d,e,f)6つの実数によるタプル、但し出力画像の座標を(x,y)とするとき、 入力画像のピクセル座標が (a*x + b*y + c, d*x + e*y + f) となる。 内挿法: Image.NEAREST, Image.BILINEAR, Image.BICUBIC のどれか。 それぞれ、最近隣内挿法、共一次内挿法、3次畳み込み内挿法。 省略すると NEAREST 
  | |
| save() | 保存
    
  |