Open In App

Wand stereogram() function in Python

Improve
Improve
Like Article
Like
Save
Share
Report

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 :

Parameter Input Type Description
left wand.image.Image() Left-eye image.
right wand.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:



Last Updated : 08 May, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads