国产探花免费观看_亚洲丰满少妇自慰呻吟_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程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乌海市| 西宁市| 武安市| 资阳市| 北宁市| 屏东市| 嘉义县| 奇台县| 巩义市| 仙游县| 百色市| 木兰县| 安陆市| 惠州市| 开鲁县| 乡宁县| 尚义县| 本溪| 元谋县| 永德县| 织金县| 甘谷县| 都匀市| 濮阳县| 乌兰县| 册亨县| 德化县| 临泽县| 梅州市| 当涂县| 称多县| 城市| 绩溪县| 贵港市| 海伦市| 青州市| 金塔县| 凤城市| 新泰市| 辽阳县| 隆回县|