Overview
TheCropAspectRatio enum defines predefined aspect ratios that can be used with the crop_aspect_ratio parameter in EditOptions. These ratios are commonly used in professional photography for specific output formats.
Import
Enum Values
Standard 2:3 aspect ratio, commonly used in portrait and traditional photography.Value:
"2X3"Use cases:- Traditional portrait orientation
- 4x6 inch prints
- Standard photo frames
4:5 aspect ratio, popular for social media and modern portrait photography.Value:
"4X5"Use cases:- Instagram portrait posts
- Modern portrait photography
- 8x10 inch prints
5:7 aspect ratio, commonly used for standard print sizes.Value:
"5X7"Use cases:- 5x7 inch prints
- Standard photo frames
- Portfolio prints
Usage Examples
Using Enum Values
Using String Values Directly
You can also use custom aspect ratios as strings without the enum:Portrait Photography with 4:5 Ratio
Wedding Photography with Standard Print Ratio
Landscape Photography with Custom Ratio
Multiple Aspect Ratios Comparison
Notes
- The
crop_aspect_ratioparameter is optional and only applies when a crop option is enabled - You can use the enum values or provide custom ratios as strings (e.g., “16:9”, “3:2”, “1:1”)
- The aspect ratio must be specified in the format
"width:height"when using custom strings - Aspect ratios only take effect when combined with
crop=True,portrait_crop=True, orheadshot_crop=True - The enum provides commonly used ratios, but you’re not limited to these values
Common Aspect Ratios Reference
| Ratio | Format | Common Uses |
|---|---|---|
2:3 | Traditional | 4x6 prints, portrait photography |
3:2 | Classic 35mm | Standard DSLR output, 6x4 prints |
4:5 | Modern portrait | Instagram, 8x10 prints |
5:7 | Standard print | 5x7 frames, album prints |
16:9 | Widescreen | Cinematic, landscape, video thumbnails |
1:1 | Square | Instagram, profile pictures |
9:16 | Vertical video | Stories, reels, TikTok |