- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Applying MedianFilter on an image using Pillow library
In this program, we will apply a minimum filter on an image using the pillow library. In median filtering, the value of each pixel in a selected window of the image is replaced by the median of that window. The filter function is used to apply different filters using the pillow library.
Original Image
Algorithm
Step 1: Import Image from Pillow. Step 2: Open the image. Step 3: Call the filter function and specify the median filter. Step 4: Display the output.
Example Code
from PIL import Image, ImageFilter im = Image.open('testimage.jpg') im1 = im.filter(ImageFilter.MedianFilter(size = 7)) im1.show()
Output
- Related Articles
- Applying MinFilter on an image using Pillow library
- Applying MaxFilter on an image using Pillow library
- Applying ModeFilter on an image using Pillow library
- Applying Gaussian Blur to an image using the Pillow library
- Applying Box Blur to an image using the Pillow library
- Applying rank filter to an image using the Pillow library
- Rotating an image using Pillow library
- Cropping an image using the Pillow library
- Loading and displaying an image using the Pillow library
- How to add text on an image using Pillow in Python?
- Finding edges in an image using Pillow
- Calculating the median of all pixels for each band in an image using the Pillow library
- Calculating the mean of all pixels for each band in an image using the Pillow library
- Calculating the variance of all pixels for each band in an image using the Pillow library
- Calculating the standard deviation of all pixels for each band in an image using the Pillow library

Advertisements