�齬3

����α齬�Ǥ� Python �� PIL (Python Imaging Library) �����Ѥ��롣
python �ؤ� path ���̤äƤ��뤳�Ȥ��ǧ���Ƥ������ȡ� (�̤äƤ��ʤ����� /pub/sol8/bin �� .cshrc �� path ����ΤȤ����� �ɲä��Ƥ���)

  1. PIL������
    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 ����ȥ�����ܣĤǽ�λ
    
    ������ xv ��ɽ�������Τ��ǧ�����顢xv ��(������å�->Quit)�ǽ�λ���Ƥ������ȡ�
  2. PIL �δؿ� ... ����α齬�ǻȤ� PIL �ؿ��Ȼ�����ϰʲ��ΤȤ���
    open()�����ե�����򳫤���Image���󥹥��󥹤��֤�
    >>> im = Image.open("�ե�����̾")
    
    show()ɽ��(�ºݤˤ� xv ����ư�����)
    >>> im.show()
    
    transform(AFFINE)���ե����Ѵ�
    ��: transform(������,Image.AFFINE, �Ѵ�����, ����ˡ)
    ������:(x,y)���Ĥ������ˤ�륿�ץ�
    �Ѵ�����:(a,b,c,d,e,f)���Ĥμ¿��ˤ�륿�ץ롢â�����ϲ����κ�ɸ��(x,y)�Ȥ���Ȥ��� ���ϲ����Υԥ������ɸ�� (a*x + b*y + c, d*x + e*y + f) �Ȥʤ롣
    ����ˡ: Image.NEAREST, Image.BILINEAR, Image.BICUBIC �Τɤ줫�� ���줾�졢�Ƕ�������ˡ�����켡����ˡ��3�����߹�������ˡ�� ��ά����� NEAREST
    >>> imx = im.transform(im.size, Image.AFFINE, (1.1,0.1,-40.0,0.05,1.2,-40.0))
    
    save()��¸
    >>> imx.save('tanux.ppm','PPM')
    
    PIL �Υۡ���ڡ��� -> �ϥ�ɥ֥å� -> Image module �ˤϡ������¿���δؿ��ˤĤ��Ƥ��������ܤäƤ���
    PDF�� PIL Handbook
  3. �齬2�˺ܤ����������飲�İʾ������� ���ե����Ѵ��θ��̤��Ƥߤʤ��������κݡ�
    1. �Ѵ���β������Х�󥹤褯���ޤ�褦�����դ���
    2. ���硦�̾���ȿž���줾��θ��̤�����褦�˷�����Ĵ������
    3. ����ˡ�ΰ㤤�ˤ����̤ˤĤ��Ƥ��ǧ��
    �ʤ�����
  4. �ʾ�α齬�η�̤�ͻ���򤨤� HTML ʸ��Ȥ��ƺ�������~/public_html/image/ex3.html ����¸���ʤ�����
  5. ;͵������� PIL �Τ���¾�� transform() �ˤĤ��Ƥ�Ĵ�٤� �¹Ԥ��Ƥߤ�Ȥ褤��
  6. �����;͵������С���󥺤δ����Ĥ���ץ�������� �� PIL (Python) �ǥץ�����ߥ󥰤��Ƥߤ�Τ⡢�ʤ��褤��