立體圖效果是在圖像內部生成圖像的效果。立體圖是圖片中的圖片。正確查看時,隱藏在每個圖像內部的對象會以3D形式顯示。
stereogram()函數使用兩個Image實例(每隻眼睛一個),並通過將Red&Cyan分開來創建3d圖像。
用法:
wand.image.stereogram(left, right)
參數:
參數 | 輸入類型 | 描述 |
---|---|---|
left | wand.image.Image() | Left-eye圖片。 |
right | wand.image.Image() | Right-eye圖片。 |
源圖像:
範例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")
輸出:
源圖像:
範例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")
輸出:
相關用法
- Python Wand function()用法及代碼示例
- Python Wand gaussian_blur()用法及代碼示例
- Python Wand transform()用法及代碼示例
- Python Wand crop()用法及代碼示例
- Python Wand rotational_blur()用法及代碼示例
- Python Wand Image()用法及代碼示例
- Python Wand shade()用法及代碼示例
- Python Wand sharpen()用法及代碼示例
- Python Wand adaptive_sharpen()用法及代碼示例
- Python Wand noise()用法及代碼示例
- Python Wand blue_shift()用法及代碼示例
- Python Wand color_matrix()用法及代碼示例
- Python Wand unsharp_mask()用法及代碼示例
- Python Wand colorize()用法及代碼示例
- Python Wand fx()用法及代碼示例
注:本文由純淨天空篩選整理自RahulSabharwal大神的英文原創作品 Wand stereogram() function in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。