Skip to content
Related Articles

Related Articles

Wand vignette() function in Python

View Discussion
Improve Article
Save Article
  • Last Updated : 16 Oct, 2021

Vignette effect creates a soft and blurry elliptical frame to the image. Vignette effect is used to apply focus to the part of image we want. The x & y arguments are used to control edge of the ellipse inset from the image border, and radius & sigma argument to control the blurriness. The radius can be omitted if you wish ImageMagick to select a value from the defined sigma value.
 

Syntax : 
 

wand.image.vignette(radius, sigma, x, y)

Parameters : 

 

ParameterInput TypeDescription
radiusnumbers.RealThe radius of the Gaussian 
 
sigmanumbers.RealThe standard deviation of the Gaussian, in pixels 
 
xnumbers.Integerx-edge of ellipse 
 
ynumbers.Integery-edge of ellipse 
 

Source Image: 
 

Example 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")

Output: 
 

Example 2: Increasing sigma value 
 

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")

Output: 
 

 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!