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

首頁 > 編程 > Python > 正文

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

2020-02-23 01:29:00
字體:
來源:轉載
供稿:網友

本文實例講述了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程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 栖霞市| 西乡县| 长顺县| 阿拉善右旗| 潞城市| 武清区| 鹤庆县| 尚义县| 昆山市| 天峻县| 永宁县| 舒兰市| 金溪县| 西安市| 汤原县| 古蔺县| 同德县| 松阳县| 巩义市| 五峰| 金昌市| 莫力| 镇康县| 衡南县| 电白县| 随州市| 韶山市| 孝感市| 花莲县| 定日县| 义马市| 舞钢市| 禄劝| 蕲春县| 通江县| 普兰店市| 五常市| 榆树市| 留坝县| 桃园县| 腾冲县|