In this tutorial I will show you how to blur an image in python.
To blur an Image:
You can use OpenCV LIbrary, which provides various image processing methods including blurring.
Install the opencv-python Library:
pip install opencv-python
Example Program:
import cv2 try: image = cv2.imread('angelina.jpg') blurred_image = cv2.GaussianBlur(image, (15, 15), 0) cv2.imshow('Original Image', image) cv2.imshow('Blurred Image', blurred_image) cv2.waitKey(0) cv2.destroyAllWindows() output_path = 'blurred_image.jpg' cv2.imwrite(output_path, blurred_image) cv2.waitKey(0) cv2.destroyAllWindows() except Exception as e: print(f"An error occurred: {e}")
OUTPUT:

VIDEO GUIDE:
Post your comments / questions
Recent Article
- Fix-Gradient effect turning to gray in after effects
- ModuleNotFoundError: No module named 'whois' in Python GoviralHost Without Terminal
- How to Convert Image to Pencil Sketch in Python?
- AttributeError: module 'urllib' has no attribute 'request' - Python
- How to Extract audio from video files using python?
- PermissionError: [Errno 13] Permission denied: 'shampoo_sales.csv' - Python
- [WinError 145] The directory is not empty: 'FolderPath' - Python
- How to generate barcode using python?
Related Article