Prompt
I'm trying to automate image resizing for a CMS, what do you recommend?
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
For a CMS, the best approach is usually:
Recommended setup
Use an image processing library/service that can:
- resize on upload
- generate multiple sizes
- preserve aspect ratio
- optionally crop to fit
- convert to modern formats like WebP/AVIF
- cache or store derivatives separately from originals
Good options
If you want to do it in your app
- Sharp (Node.js) — fast, reliable, great quality
- Pillow (Python) — flexible and common
- ImageMagick — powerful, but heavier and sometimes more complex
If you want a managed solution
- Cloudinary
- Imgix
- Cloudflare Images These are great if you want automatic resizing, optimization, CDN delivery, and less server load.
Best practice workflow
- Store the original upload
- Generate a few preset sizes, like:
- thumbnail
- card image
- medium content image
- large hero image
- Keep filenames or metadata indicating width/height/format
- Serve responsive images with
srcset - Lazy-load images where appropriate
- Compress and convert to WebP/AVIF when supported
Typical CMS image sizes
A common set might be:
- 150px thumbnail
- 400px small
- 800px medium
- 1200px large
- 2000px extra large
Important considerations
- Don’t resize by stretching — maintain aspect ratio
- Avoid upscaling unless necessary
- Strip metadata if privacy matters
- Handle orientation from EXIF
- Use async processing for large uploads to avoid slowing requests
My recommendation
If you’re building your own CMS and want something practical:
- Use Sharp if your stack is Node.js
- Pair it with a queue/background worker
- Store original + generated variants
- Serve via CDN
If you want, I can give you:
- a Node.js Sharp example,
- a Python Pillow example, or
- a full CMS image pipeline design.