AI-Powered Cropping¶
Intelligent cropping algorithms that automatically focus on the most important parts of your images using artificial intelligence and computer vision techniques.
Crop Modes¶
crop=faces¶
AI-powered face detection automatically centres the crop area on detected human faces when used with fit=crop.
Use Cases:
- Profile pictures and avatars
- Social media images
- Portrait photography
- Team member photos
Example:
crop=objects¶
Object detection AI identifies and focuses on the main subject/object when used with fit=crop.
Use Cases: - Product photography - E-commerce listings - Marketing materials - Catalog images
Example:
crop=attention¶
Uses visual attention algorithms to identify areas that naturally draw the human eye.
Use Cases: - General purpose smart cropping - Social media content - Hero images - Thumbnail generation
Example:
crop=entropy¶
Focuses on areas with the highest visual complexity and detail, preserving the most information-rich parts of the image.
Use Cases: - Technical documentation - Detailed imagery - Scientific photography - Architecture photography
Example:
crop=edges¶
Edge detection algorithms identify and preserve sharp lines, boundaries, and structural elements in the image.
Use Cases:
- Architecture photography
- Technical drawings
- Geometric artwork
- Industrial photography
Example:
fit=facearea¶
Dedicated face-area fit mode that applies face-aware cropping directly.
Example:
How AI Cropping Works¶
- Analysis: AI algorithms analyze the entire image to identify important features
- Selection: Depending on crop mode, the optimiser selects either a smartcrop strategy or an AI-detected region
- Optimization: The crop area is positioned to maximize the score while fitting the requested dimensions
- Fallback: If AI detections are unavailable, crop behavior falls back to deterministic defaults
Best Practices¶
Face Detection Cropping¶
- Works best with clear, well-lit portraits
crop=facesandfit=faceareaboth center around detected faces- If no faces are detected, the crop falls back to top-left gravity
Object Detection Cropping¶
- Optimized for a single primary subject
- Works well with products, animals, vehicles
- Best results with clear subject-background separation
- When multiple objects are detected, the highest-confidence object is used as the focal point
Attention-Based Cropping¶
- Mimics human visual attention patterns
- Considers color contrast, complexity, and patterns
- Good general-purpose option when specific features aren't known
- Balances multiple visual elements
Entropy Cropping¶
- Preserves maximum visual information
- Excellent for images with fine details
- May not always be aesthetically optimal
- Best for technical or documentary purposes
Edge Detection Cropping¶
- Preserves structural and geometric elements
- Excellent for architectural photography
- Works well with high-contrast images
- May not work well with soft, organic subjects
Performance Considerations¶
- AI cropping adds minimal processing time (~50-200ms)
- Results are cached globally for subsequent requests
- Face detection is fastest, object detection takes slightly longer
- Attention and entropy analysis are moderately complex
- Edge detection is computationally lightweight
Combining with Other Parameters¶
Smart Cropping with Enhancement¶
Product Focus with Padding¶
Attention Cropping with Effects¶
Fallback Behavior¶
When AI algorithms cannot detect suitable features:
1. fit=crop&crop=faces: If face detection runs but finds nothing, falls back to top-left crop coordinates.
2. fit=crop&crop=objects: If object detection runs but finds nothing, falls back to top-left crop coordinates.
3. fit=crop&crop=faces,objects: Faces are attempted first, then objects; when detection runs but nothing is found, fallback is top-left.
4. fit=facearea: If face detection is disabled, this fit mode errors and must rely on fit sequencing (for example fit=facearea,crop) for fallback behavior.
Mode Priority and Combinations¶
crop=faces,objectsis supported, butfacesis attempted first.objectsis acropmode, not afitmode.- If neither
facesnorobjectscan run (for example, related feature flags are disabled), crop processing falls back to non-AI smartcrop behavior.
Examples by Use Case¶
Social Media Profiles¶
E-commerce Products¶
Blog Post Thumbnails¶
Architecture Photography¶
Detailed Documentation¶
AI-powered cropping ensures your images are automatically optimized for their intended use, saving time while delivering professional results.