Computer-Vision

Basic Image Processing with Python

Learn basic image processing techniques using Python’s built-in libraries with practical examples.

  1. Load image:
from PIL import Image
img = Image.open('image.jpg')
  1. Convert to grayscale:
gray_img = img.convert('L')
  1. Resize image:
resized = img.resize((256, 256))
  1. Apply filters:
from PIL import ImageFilter
blurred = img.filter(ImageFilter.BLUR)
sharpened = img.filter(ImageFilter.SHARPEN)
  1. Save processed image:
resized.save('processed.jpg')

Advanced techniques:

  • Edge detection
  • Histogram equalization
  • Image segmentation
  • Feature extraction
  • Object detection

Read more: Pillow Documentation