Skip to main content

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​

OptionDescriptionDefault
--sourcePath to image file or folder (required)--
--outputOutput directory_output/media
--platformTarget platform: instagram, facebook, linkedin, twitter, youtube--
--variantPlatform variant (e.g., square, story, post, cover)--
--all-platformsProcess to all available presetsfalse
--widthCustom target width--
--heightCustom target height--
--modeResize mode: fit, fill, stretchfill
--qualityOutput quality 1-10085
--formatOutput format: jpeg, png, webpSame as source
--extendCanvas extension in pixels--
--fill-colorFill color for canvas extension (hex)#FFFFFF
--remove-bgRemove background before processingfalse
--resumeResume incomplete batchfalse

Prerequisites​

  • Repo: content-conductor
  • Install: pip install -r requirements.txt from 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