Skip to content
Related Articles

Related Articles

Wand polaroid() function – Python
  • Last Updated : 08 May, 2020

polaroid() is one of function with simplest functionality. It generates image with a white border with a slight shadow to create a special effect of a Polaroid print.

Syntax :

wand.image.polaroid(angle, caption, font, method)

Parameters :

ParameterInput TypeDescription
anglenumbers.Realapplies a shadow effect along this angle.
captionbasestringWrites a message at the bottom of the photo’s border.
fontwand.font.FontSpecify font style.
methodbasestringInterpolation method. ImageMagick-7 only.

Source Image:

Example 1:






# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
    # Polaroid image using polaroid() function
    img.polaroid()
    img.save(filename ="polkoala.jpeg")

Output :

Example 2:
Add caption and angle to image




# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
    # Polaroid image using polaroid() function
    img.polaroid(angle = 1.0, caption ="Hi Koala")
    img.save(filename ="polkoala2.jpeg")

Output:

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :