Nitro Image
Resize, convert, and optimise images with a chainable API. Generate responsive sizes in one call.
$ pip install nitro-imageFeatures
Chainable API
Queue operations and execute lazily. Build complex pipelines with clean, readable code.
Resize and crop
Multiple strategies including resize, thumbnail, cover, contain, and smart crop.
Format conversion
Convert between WebP, PNG, JPEG, and AVIF with automatic format selection.
Adjustments and effects
Brightness, contrast, sharpen, blur, grayscale, sepia, and rounded corners.
Watermark and text
Add logos and text overlays with positioning and opacity control.
Responsive images
Generate multiple sizes for responsive design in a single operation.
Placeholders
Generate LQIP, dominant colour, BlurHash, and SVG placeholders for fast loading.
Built-in presets
Common presets for thumbnails, avatars, OG images, and banners ready to use.
Batch processing
Process multiple images at once with parallel execution support.
Quick example
from nitro_img import Image, presets
# Chainable API with lazy execution
(
Image("photo.jpg")
.resize(800)
.sharpen(1.2)
.webp(quality=85)
.save("output.webp")
)
# Generate responsive sizes for a srcset
(
Image("hero.jpg")
.webp(quality=80)
.save_responsive("build/images/", [320, 640, 1024, 1920], name="hero")
)
# Use presets
presets.avatar("avatar.jpg", size=128)
presets.og_image("post.jpg")Recipes
Crop an image in Python
Get the four numbers in the box right, then crop to the centre, a square or any ratio.
Read ->Pillow in Python
Install Pillow, import it under its old name, and do the five jobs most scripts need.
Read ->Resize an image in Python
Shrink an image without squashing it, blurring it or making it bigger by accident.
Read ->