PIL的操作

具体操作:

http://www.cnblogs.com/way_testlife/archive/2011/04/20/2022997.html
http://www.cnblogs.com/way_testlife/archive/2011/04/17/2019013.html

pip install Pillow

im = Image.open('filename') 
r,g,b = im.split()   #分割成三个通道
im.size()
>>>(32,28)

out = img.resize((128, 128))   #resize成128*128像素大小。
out = img.rotate(45)   #逆时针旋转45度 
region = im.crop((100, 100, 400, 400))      
//  四元组(左,上,右,下)     此处为 (100,100)->(400,400)之间的矩形位置 。

你可能感兴趣的:(PIL的操作)