Wand stereogram() function in Python
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: