Wand matte_color property in Python

Some distortion transitions can not be calculated in the virtual-pixel space. Either being invalid, or NaN (not-a-number). You can define how such a pixel should be represented by setting the Image.matte_color property.
Syntax :
wand.image.matte_color = 'color'
Source Image:
Example 1:
from wand.color import Color # Import Image from wand.image module from wand.image import Image    # Read image using Image function with Image(filename ="gog.png") as img:     img.matte_color = Color('BLUE')     img.virtual_pixel = 'tile'      args = (0, 0, 30, 60, 140, 0, 110, 60,             0, 92, 2, 90, 140, 92, 138, 90)     img.distort('perspective', args)     img.save(filename ="rdmc.jpg") |
Output :
Example 2:
changing VIRTUAL_PIXEL_METHOD to tile
from wand.color import Color # Import Image from wand.image module from wand.image import Image    # Read image using Image function with Image(filename ="gog.png") as img:     arguments = (0, 0, 20, 60,                  90, 0, 70, 63,                  0, 90, 5, 83,                  90, 90, 85, 88)     img.matte_color = Color('YELLOW')     img.distort('perspective', arguments)     img.save(filename ='mattegog.png') |
Output :
<!–
–>

Wand selective_blur() function in Wand python

Wand virtual_pixel property – Python

Python – Read blob object in python using wand library

Wand image – Baseimage.kuwahara() function in Python

Wand image.emboss in Python

Wand image.edge function in Python

Wand image.despeckle() in Python

Wand gaussian_blur() function in Python

Wand transform() function in Python

Wand crop() function in Python




Please Login to comment…