国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

python簡單實現旋轉圖片的方法

2019-11-25 17:21:09
字體:
來源:轉載
供稿:網友

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

# 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 installedimport Image# open an image file (.bmp,.jpg,.png,.gif)# change image filename to something you have in the working folderim1 = Image.open("Donald.gif")# rotate 60 degrees counter-clockwiseim2 = 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 typeim2.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 extensionim2.save("d.gif")

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 渭源县| 北宁市| 阿瓦提县| 琼中| 虹口区| 广南县| 化德县| 昌吉市| 万山特区| 新津县| 息烽县| 惠来县| 聂拉木县| 麻阳| 黑水县| 龙南县| 延吉市| 青阳县| 湾仔区| 延长县| 荥经县| 盐亭县| 鄂温| 普兰县| 台湾省| 盘锦市| 静安区| 安义县| 丹棱县| 弥渡县| 双峰县| 巴东县| 贵州省| 扎兰屯市| 漳州市| 三台县| 巧家县| 潼南县| 铜川市| 湖北省| 石门县|