国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

如何用python反轉(zhuǎn)圖片,視頻

瀏覽:5日期:2022-06-21 11:55:22
利用python反轉(zhuǎn)圖片/視頻 準備:一張圖片/一段視頻 python庫:Pillow,moviepy 安裝庫

pip install Pillow -i https://mirrors.aliyun.com/pypi/simplepip install moviepy -i https://mirrors.aliyun.com/pypi/simple

默認官方鏡像源,我這里嘗試的時候沒有任何進度。切換到國內(nèi)的源,比如阿里鏡像,清華鏡像即可。第一次使用國內(nèi)源,簡直是神速!

反轉(zhuǎn)效果

如何用python反轉(zhuǎn)圖片,視頻

反轉(zhuǎn)后

如何用python反轉(zhuǎn)圖片,視頻

實現(xiàn)代碼

圖片

from PIL import Image, ImageOpsimg = Image.open(’img/python.jpg’)img_mirror = ImageOps.mirror(img)img_mirror.save(’img/python_mirror.jpg’)

視頻

import moviepyfrom moviepy.editor import VideoFileClip,vfxvideo = VideoFileClip(’video/video.mp4’)reversed_video = video.fx(vfx.mirror_x)reversed_video.write_videofile(’video/vide_reverse.mp4’)項目地址

https://github.com/coder-chin/reverseImg

以上就是如何用python反轉(zhuǎn)圖片,視頻的詳細內(nèi)容,更多關(guān)于python反轉(zhuǎn)圖片,視頻的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 宁化县| 平山县| 满洲里市| 普格县| 永寿县| 屯留县| 德化县| 陈巴尔虎旗| 石城县| 龙山县| 陇川县| 莒南县| 乾安县| 册亨县| 城口县| 乌什县| 浦县| 巴彦县| 平阴县| 大化| SHOW| 伊春市| 金华市| 和平县| 阳谷县| 九江市| 界首市| 莆田市| 秦皇岛市| 金阳县| 平南县| 鄱阳县| 博野县| 德江县| 休宁县| 玉门市| 偃师市| 雷州市| 竹北市| 宿松县| 武强县|