📜  Python中的Wand flop()函数

📅  最后修改于: 2022-05-13 01:55:48.209000             🧑  作者: Mango

Python中的Wand flop()函数

在本文中,我们将学习什么是翻转()函数。基本上这个函数返回一个翻转的图像。翻转效果将图像倒置或创建图像的垂直反射。此函数中不需要任何参数。

示例 1:
源图像:

Python3
# Import Image from wand.image module
from wand.image import Image
 
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
 
    with img.clone() as fimg:
        # flopped image using flop() function
        fimg.flop()
        fimg.save(filename ='koalaflopped.jpeg')


Python3
from wand.image import Image
 
# Read image using Image function
with Image(filename ="man.jpeg") as img:
    with img.clone() as fimg:
        # flopped image using flop() function
        fimg.flop()
        fimg.save(filename ='manflopped.jpeg')


输出:

示例 2:
源图像:

Python3

from wand.image import Image
 
# Read image using Image function
with Image(filename ="man.jpeg") as img:
    with img.clone() as fimg:
        # flopped image using flop() function
        fimg.flop()
        fimg.save(filename ='manflopped.jpeg')

输出: