Skip to content

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 centers the crop area on detected human faces.

Use Cases: - Profile pictures and avatars - Social media images
- Portrait photography - Team member photos

Example:

image.jpg?w=300&h=300&fit=crop&crop=faces

crop=objects

Object detection AI identifies and focuses on the main subjects or objects in the image.

Use Cases: - Product photography - E-commerce listings - Marketing materials - Catalog images

Example:

product.jpg?w=400&h=400&fit=crop&crop=objects

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:

image.jpg?w=800&h=600&fit=crop&crop=attention

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:

image.jpg?w=500&h=400&fit=crop&crop=entropy

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:

building.jpg?w=600&h=400&fit=crop&crop=edges

How AI Cropping Works

  1. Analysis: AI algorithms analyze the entire image to identify important features
  2. Scoring: Different areas are scored based on the selected algorithm (faces, objects, attention, etc.)
  3. Optimization: The crop area is positioned to maximize the score while fitting the requested dimensions
  4. Fallback: If no features are detected, falls back to center cropping

Best Practices

Face Detection Cropping

  • Works best with clear, well-lit portraits
  • Can detect multiple faces and center on the group
  • Automatically adjusts for different face sizes and orientations
  • Fallback to center crop if no faces detected

Object Detection Cropping

  • Optimized for single primary subjects
  • Works well with products, animals, vehicles
  • Best results with clear subject-background separation
  • Handles multiple objects by focusing on the largest/most prominent

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

portrait.jpg?w=400&h=400&fit=crop&crop=faces&brightness=10&contrast=15

Product Focus with Padding

product.jpg?w=500&h=500&fit=crop&crop=objects&pad=20&bg=white

Attention Cropping with Effects

landscape.jpg?w=800&h=600&fit=crop&crop=attention&saturation=15&contrast=20

Fallback Behavior

When AI algorithms cannot detect suitable features: 1. Faces: Falls back to center cropping 2. Objects: Falls back to attention-based cropping, then center 3. Attention: Falls back to entropy-based cropping, then center 4. Entropy: Falls back to center cropping 5. Edges: Falls back to center cropping

Examples by Use Case

Social Media Profiles

profile.jpg?w=400&h=400&fit=crop&crop=faces&brightness=5&contrast=10

E-commerce Products

product.jpg?w=500&h=500&fit=crop&crop=objects&pad=30&bg=white&q=85

Blog Post Thumbnails

article.jpg?w=300&h=200&fit=crop&crop=attention&saturation=10

Architecture Photography

building.jpg?w=800&h=600&fit=crop&crop=edges&contrast=20&sharpen=15

Detailed Documentation

diagram.jpg?w=600&h=400&fit=crop&crop=entropy&q=95&fm=png

AI-powered cropping ensures your images are automatically optimized for their intended use, saving time while delivering professional results.