tint()函數通過混合給定的顏色來使圖像的中間色調著色。 alpha參數控製顏色通道之間的混合效果。但是,使用它可能很棘手,因此在有疑問時,請使用alpha =” gray(50)”參數。
用法:
wand.image.tint(color, alpha)
參數:
參數 | 輸入類型 | 描述 |
---|---|---|
color | Color | 顏色以計算中間調。 |
alpha | Color | 確定如何混合。 |
源圖像:
範例1:
# Import Image from wand.image module
from wand.image import Image
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
# tinted image using tint() function
img.tint(color ="yellow", alpha ="rgb(40 %, 60 %, 80 %)")
img.save(filename ="tintkoala.jpeg")
輸出:
範例2:數量增加值
# Import Image from wand.image module
from wand.image import Image
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
# implode imagefx using implode() function
img.tint(color ="green", alpha ="rgb(10 %, 20 %, 40 %)")
img.save(filename ="tint2.jpeg")
輸出:
相關用法
- Python Wand tint()用法及代碼示例
- 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()用法及代碼示例
注:本文由純淨天空篩選整理自RahulSabharwal大神的英文原創作品 Wand tint() function in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。