Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Wand flip() function in Python

  • Last Updated : 16 Oct, 2021

In this article we will learn what is flip() function. Basically this function returns a flipped image. Flip effect flips an image upside-down or creates an vertical reflection of image. No arguments are needed in this function.
 

Syntax : wand.image.flip()
Parameters : No Parameters in flip() function.

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course

Source Image: 
 



Example 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:
        # flip image using flip() function
        fimg.flip()
        fimg.save(filename ='koalaflipped.jpeg')

Output: 
 

Example 2:
Source Image: 
 

 

Python3




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

Output: 
 

 




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!