重映射效果将所有像素替换为在亲和力参考图像中找到的最接近的匹配像素。 remap()用给定的亲和力图像重建最接近颜色的调色板。
用法: wand.image.remap(affinity, method)
参数:
参数 | 输入类型 | 描述 |
---|---|---|
affinity | BaseImage | 参考图片。 |
method | basestring | 抖动方法。参见DITHER_METHODS。默认值为‘no’抖动。 |
输入图片:
范例1:
# Import Image from wand.image module
from wand.image import Image
with Image(filename ="koala.jpeg") as left:
with left.clone() as right:
with Image(width = 100, height = 1, pseudo ="plasma:") as affinity:
# remap image using remap() function
right.remap(affinity)
left.extent(width = left.width * 2)
# adding remaped image with original image
left.composite(right, top = 0, left = right.width)
left.save(filename ="remapk.jpeg")
输出:
输入图片:
范例2:
# Import Image from wand.image module
from wand.image import Image
with Image(filename ="road.jpeg") as left:
with left.clone() as right:
with Image(width = 100, height = 1, pseudo ="plasma:") as affinity:
# remap image using remap() function
right.remap(affinity)
left.extent(width = left.width * 2)
# adding remaped image with original image
left.composite(right, top = 0, left = right.width)
left.save(filename ="roadr.jpeg")
输出:
相关用法
- 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 remap() function in Python。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。