Skip to Content
Dynamic ImageFace Detection

Face Detection

The face detection feature automatically detects people’s faces in images and makes them the center of the crop, ensuring important facial features remain visible after image transformations.

Face Crop Parameter

Parameter: face_crop
Format 1: Boolean
Format 2: width,height

How It Works

The face crop feature uses intelligent detection algorithms to identify faces in your images and automatically adjusts the crop to keep faces centered and visible.

Boolean Format (Format 1)

When set to true, the optimizer will:

  • Find all faces it can detect in the image
  • Ensure that all detected faces remain in frame
  • Add appropriate padding around the faces
  • Automatically determine the best crop area
?face_crop=true

Dimension Format (Format 2)

When you specify width and height dimensions, the optimizer will:

  • Detect all faces in the image
  • Focus on the center point between all faces (or center of one face if only one is found)
  • Crop the image to match the specified width and height
  • Use the detected faces as the center point for the crop
?face_crop=800,1000

Examples

Automatic Face-Centered Crop

# Automatically crop to include all faces with padding https://cdn.filezen.dev/image.jpg?face_crop=true

Fixed Dimensions with Face Focus

# Crop to 800x1000 pixels centered on detected faces https://cdn.filezen.dev/image.jpg?face_crop=800,1000 # Square crop centered on faces https://cdn.filezen.dev/image.jpg?face_crop=500,500

Use Cases

Profile Pictures

Perfect for automatically cropping profile pictures to focus on the person’s face:

?face_crop=400,400

Thumbnail Generation

Generate thumbnails that always keep faces visible:

?face_crop=true&width=200&height=200

Social Media Images

Create social media-ready images with proper face positioning:

?face_crop=1200,630

Combining with Other Parameters

Face detection works well with other image manipulation parameters:

# Face-centered crop with quality adjustment ?face_crop=true&quality=80 # Face-centered crop with specific dimensions and blur background ?face_crop=600,600&blur=5 # Face-centered crop with brightness adjustment ?face_crop=true&brightness=10

Best Practices

  • Use boolean format when you want automatic sizing with optimal face inclusion
  • Use dimension format when you need specific output dimensions for your application
  • Combine with quality settings to optimize file size while maintaining face clarity
  • Test with various face counts to ensure good results with single faces and group photos
  • Consider padding - the automatic padding ensures faces aren’t cropped too tightly

Limitations

  • Face detection works best with clear, well-lit faces
  • Very small faces in large images may not be detected reliably
  • Heavily obscured or profile faces may not be detected
  • The feature focuses on human faces and may not detect animal faces
Last updated on
© 2026 FileZen. All rights reserved.