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

python簡(jiǎn)單實(shí)現(xiàn)旋轉(zhuǎn)圖片的方法

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

本文實(shí)例講述了python簡(jiǎn)單實(shí)現(xiàn)旋轉(zhuǎn)圖片的方法。分享給大家供大家參考。具體實(shí)現(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")

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

曲阜市| 绍兴县| 平舆县| 南开区| 日喀则市| 弋阳县| 石景山区| 永新县| 新余市| 扎兰屯市| 六枝特区| 当雄县| 郸城县| 云安县| 乐业县| 潼关县| 乌鲁木齐县| 宜兰县| 磴口县| 定安县| 雷山县| 额济纳旗| 江津市| 汶川县| 左权县| 新绛县| 莱芜市| 大方县| 柘城县| 太湖县| 西畴县| 比如县| 绿春县| 公安县| 凉山| 曲阜市| 泰来县| 宣武区| 保靖县| 稷山县| 灌阳县|