process-image
Overview
Resize, crop, and optimize images for social media platforms. Supports platform presets (Instagram, Facebook, LinkedIn, Twitter, YouTube), custom dimensions, background removal, canvas extension, and batch processing with resume.
Usage
python main.py process-image --source SOURCE [OPTIONS]
Options
| Option | Description | Default |
|---|---|---|
--source | Path to image file or folder (required) | -- |
--output | Output directory | _output/media |
--platform | Target platform: instagram, facebook, linkedin, twitter, youtube | -- |
--variant | Platform variant (e.g., square, story, post, cover) | -- |
--all-platforms | Process to all available presets | false |
--width | Custom target width | -- |
--height | Custom target height | -- |
--mode | Resize mode: fit, fill, stretch | fill |
--quality | Output quality 1-100 | 85 |
--format | Output format: jpeg, png, webp | Same as source |
--extend | Canvas extension in pixels | -- |
--fill-color | Fill color for canvas extension (hex) | #FFFFFF |
--remove-bg | Remove background before processing | false |
--resume | Resume incomplete batch | false |
Prerequisites
- Repo: content-conductor
- Install:
pip install -r requirements.txtfrom repo root - Background removal (optional):
pip install rembg onnxruntime
Examples
Process to Instagram square
python main.py process-image --source photo.jpg --platform instagram --variant square
Process to all platforms
python main.py process-image --source photo.jpg --all-platforms
Custom dimensions with quality
python main.py process-image --source photo.jpg --width 800 --height 600 --quality 90
Remove background then resize
python main.py process-image --source logo.jpg --platform instagram --variant square --remove-bg --format png
Related Commands
cc generate-logo-package-- generate multi-platform logo packagecc images-to-pdf-- convert images to PDF