Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

Illustration of color to grayscale to binary threshold conversion using OpenCV.
Python

Python OpenCV: Color Conversion, Grayscale, and Thresholding

Convert images to grayscale and apply thresholding with OpenCV in Python. Covers fixed, Otsu, and adaptive thresholding.

OpenCVGrayscaleThresholdingImage Processing
Illustration of an image being resized, cropped, and rotated through an OpenCV pipeline in Python.
Python

Python OpenCV: Read, Write, Resize, Crop, and Rotate Images

A practical walkthrough of reading, writing, resizing, cropping, and rotating images with Python OpenCV, covering BGR order, interpolation choices, and memory behavior.

OpenCVimage processingPythoncomputer vision
Comparison of Python Pillow and OpenCV for image processing showing two distinct library approaches.
Python

Python Pillow vs OpenCV: Choosing the Right Image Library

Compare Python Pillow and OpenCV for image processing: API differences, performance behavior, and when to choose each library.

PillowOpenCVImage ProcessingComputer Vision
Diagram showing conversion between Pillow image, NumPy array, and bytes in Python
Python

Python Pillow NumPy and Bytes Conversion

python pillow numpy and bytes conversion: Learn how to convert between Pillow images, NumPy arrays, and raw bytes in Python, including mode, dtype, and memory consider...

PillowNumPyImage ProcessingBytesIO
Illustration of two overlapping images with a transparent layer being composited using Python Pillow
Python

Python Pillow: Combining Images with paste, blend, and alpha_composite

Learn how to combine images with Python Pillow using paste for placement, blend for cross-fades, and alpha_composite for per-pixel transparency.

Pillowimage processingimage compositionalpha blending
A 2x2 grid showing the same landscape photo in original color, grayscale, blurred, and sharpened versions to illustrate Pillow image filters.
Python

Python Pillow: Grayscale, Blur, Sharpen, and Image Filters

Use Pillow's ImageFilter module to convert images to grayscale, apply Gaussian or box blur, sharpen images, and run built-in edge-detection filters. Includes Python examples.

PillowImage ProcessingGrayscaleBlur
Diagram showing an RGBA image with a transparent checkerboard background and an alpha channel overlay.
Python

Python Pillow Transparency: Alpha and Background Handling

Learn how to handle alpha channels in Pillow: convert to RGBA, composite images, paste with masks, flatten transparency, and save with the correct format limitations.

Pillowimage processingalpha channeltransparency
Illustration of a Python Pillow script drawing text and shapes onto an image, with a semi-transparent watermark overlay.
Python

Python Pillow: Draw Text, Shapes, and Watermarks

Use Python Pillow's ImageDraw module to draw text and shapes and create semi-transparent watermarks. Includes practical code examples.

PillowImageDrawwatermarkingimage processing
A visual comparison of a high-quality image and a compressed thumbnail, with a Pillow logo and a file size gauge.
Python

Pillow Compression Quality and Thumbnails in Python

python pillow compression quality and thumbnails: Learn how to control JPEG quality, use the optimize flag, and generate thumbnails with Pillow while balancing file si...

PillowImage CompressionThumbnailsJPEG Quality
Illustration of converting image formats between JPG, PNG, and WebP using Python Pillow
Python

Convert JPG, PNG, and WebP with Python Pillow

Convert JPG, PNG, and WebP images with Python Pillow. Covers save options, transparency handling, metadata preservation, batch conversion, and choosing the right output format.

PythonPillowImage ConversionWebP