Skip to content
Related Articles

Related Articles

Improve Article
Wand stereogram() function in Python
  • Last Updated : 08 May, 2020

Stereogram Effect is the effect that generates image inside image. A stereogram is a picture within a picture. Hidden inside each image is an object which appears in 3D when viewed correctly.
stereogram() function takes two Image instances (one for each eye), and creates a 3d image by separating the Red & Cyan.

Syntax :

wand.image.stereogram(left, right)

Parameters :

ParameterInput TypeDescription
leftwand.image.Image()Left-eye image.
rightwand.image.Image()Right-eye image.

Source Image:

Example 1:






# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as leftimg:
  
    with Image(filename ="koala.jpeg") as rightimg:
        # stereogram image using stereogram function
        with Image.stereogram(left = leftimg, right = rightimg) as img:
            img.save(filename ="fx-stereogram.jpg")

Output:

Source Image:

Example 2:




# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as leftimg:
  
    with Image(filename ="koala.jpeg") as rightimg:
  
        # stereogram image using stereogram function
        with Image.stereogram(left = leftimg, right = rightimg) as img:
            img.save(filename ="fx-stereogram.jpg")

Output:

 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




My Personal Notes arrow_drop_up
Recommended Articles
Page :