Skip to content

face-center-crop

Use when generating smart-cropped image variants with face or subject centering via Cloudinary transformations. Produces portrait, square, landscape, and vertical crops optimized for ad platforms.

ModelSource
sonnetpack: ad-assets
Full Reference

Generates smart-cropped image variants using Cloudinary transformations. When classify-ad-assets reports faceDetected: true, uses g_face gravity to keep the subject’s face centered in the crop. Falls back to g_auto (content-aware auto-crop) when no face is detected. Produces four standard aspect ratio variants per asset, all auto-format and auto-quality optimized.

FactValue
Gravity (face detected)g_face
Gravity (no face)g_auto
Crop modec_fill
Format optimizationf_auto (webp/avif by browser)
Quality optimizationq_auto
Variants per asset4 (portrait, square, landscape, vertical)
Required env varCLOUDINARY_CLOUD_NAME
I want to…File
Understand the transformation string, gravity selection, and URL buildertransformations.md
Run batch crop generation and integrate with classify-ad-assetsbatch-generation.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.


┏━ 🎯 face-center-crop ━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Cropping: [asset/batch] → [aspect ratios] ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛