最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python簡單實現(xiàn)旋轉圖片的方法

 更新時間:2015年05月30日 10:08:52   作者:皮蛋  
這篇文章主要介紹了python簡單實現(xiàn)旋轉圖片的方法,涉及Python中image模塊使用技巧,需要的朋友可以參考下

本文實例講述了python簡單實現(xiàn)旋轉圖片的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

# rotate an image counter-clockwise using the PIL image library
# free from: http://www.pythonware.com/products/pil/index.htm
# make sure to install PIL after your regular python package is installed
import Image
# open an image file (.bmp,.jpg,.png,.gif)
# change image filename to something you have in the working folder
im1 = Image.open("Donald.gif")
# rotate 60 degrees counter-clockwise
im2 = im1.rotate(60)
# brings up the modified image in a viewer, simply saves the image as
# a bitmap to a temporary file and calls viewer associated with .bmp
# make certain you have an image viewer associated with this file type
im2.show()
# save the rotated image as d.gif to the working folder
# you can save in several different image formats, try d.jpg or d.png 
# PIL is pretty powerful stuff and figures it out from the extension
im2.save("d.gif")

希望本文所述對大家的Python程序設計有所幫助。

相關文章

最新評論

靖远县| 金平| 香河县| 常熟市| 哈密市| 牙克石市| 邵阳县| 宣化县| 宾阳县| 古蔺县| 普兰县| 格尔木市| 涿州市| 施甸县| 中超| 仪陇县| 成都市| 延津县| 常山县| 新竹市| 万盛区| 蓬莱市| 土默特左旗| 吕梁市| 盐津县| 东光县| 新田县| 金昌市| 武川县| 莒南县| 甘洛县| 霍州市| 富裕县| 大渡口区| 黄龙县| 焦作市| 萨嘎县| 汉沽区| 昌乐县| 高要市| 青铜峡市|