Emboss filter in Pillow

Overview:

  • The meaning of Emboss is to make a mould, a 3d- mould that stands out from the surface.

 

  • When an emboss filter is applied on an image, the resultant image looks like an emboss - a paper or metal emboss of the source Image where the features stand out in high relief (more prominently) or low relief(less prominently).

 

  • An emboss filter in Pillow, the Python Image Processing library is provided through applying a convolution of specific 3x3 matrix to the Image.

     

  • The 3x3 kernel used by Pillow for the emboss filter is given here:

         (

              -1, 0, 0,

             0, 1, 0,

             0, 0, 0

          )

 

Example:

from PIL import Image

from PIL import ImageFilter

 

# Open the Image and create an Image Object

imagePath = "./StatueOfLiberty.jpg"

imageObject = Image.open(imagePath)

imageObject.show()

 

# Apply emboss filter on to the image

imageEmboss = imageObject.filter(ImageFilter.EMBOSS)

 

# Display the embossed image

imageEmboss.show()


 

Output:

Before applying emboss filter to the image:
Before applying emboss filter to the image using Pillow

After applying emboss filter to the image:
After applying emboss filter to the image using Pillow


Copyright 2024 © pythontic.com