暈影效果為圖像創建柔和模糊的橢圓框。暈影效果用於將焦點應用於我們想要的圖像部分。 x 和 y 參數用於控製從圖像邊界插入的橢圓的邊,半徑和 sigma 參數用於控製模糊度。如果您希望 ImageMagick 從定義的 sigma 值中選擇一個值,則可以省略半徑。
用法:
wand.image.vignette(radius, sigma, x, y)
參數:
參數 | 輸入類型 | 描述 |
---|---|---|
radius | numbers.Real | 高斯半徑 |
sigma | numbers.Real | 高斯的標準偏差,以像素為單位 |
x | numbers.Integer | 橢圓x-edge |
y | numbers.Integer | 橢圓y-edge |
源圖像:
範例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:
# vignette image using vignette() function
img.vignette(sigma = 3, x = 10, y = 10)
img.save(filename ="vkoala.jpeg")
輸出:
範例2:增加西格瑪值
Python3
# Import Image from wand.image module
from wand.image import Image
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
# vignette image using vignette() function
img.vignette(sigma = 10, x = 1, y = 1)
img.save(filename ="vkoala2.jpeg")
輸出:
相關用法
- Python Wand vignette()用法及代碼示例
- 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()用法及代碼示例
- Python Wand implode()用法及代碼示例
- Python Wand polaroid()用法及代碼示例
注:本文由純淨天空篩選整理自RahulSabharwal大神的英文原創作品 Wand vignette() function in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。