frame
Straighten, crop, rotate, flip, and correct perspective in photos while measuring remaining tilt or keystone and reporting auto fixes; returns the framed preview.
Instructions
Compose the picture: straighten, perspective correction, crop, rotate and flip.
Only the fields you pass change. Every call measures the straight lines under the new framing and reports any remaining tilt or keystone, with the auto correction that would fix it. Returns the framed preview. Call with reset_framing=true and no other fields to look at the whole uncropped photo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto | No | Measure straight lines and correct automatically, like Lightroom Upright: 'level' straightens the horizon (or the verticals if there is no horizon); 'vertical' also fixes converging verticals (architecture); 'full' also fixes horizontal perspective. Fields you pass explicitly win. | |
| grid | No | Overlay a grid on the returned preview, to check level and verticals by eye. | |
| aspect | No | Crop aspect ratio (width:height). 'original' keeps the photo's own ratio. 65:24 is XPan panoramic. Default 'original'. One of: original, 3:2, 2:3, 4:3, 3:4, 1:1, 4:5, 5:4, 16:9, 9:16, 65:24, 1.85:1, 2.39:1. | |
| crop_x | No | Horizontal centre of the crop, 0 = as far left as possible, 1 = as far right. Range 0.0 to 1.0. Default 0.5. | |
| crop_y | No | Vertical centre of the crop, 0 = as far up as possible, 1 = as far down. Range 0.0 to 1.0. Default 0.5. | |
| flip_h | No | Mirror left-right. Default False. | |
| flip_v | No | Mirror top-bottom. Default False. | |
| rotate | No | Rotate in 90° steps, clockwise. Default '0'. One of 0, 90, 180, 270. | |
| crop_zoom | No | How tight the crop is: 1 = the largest crop of that aspect ratio, 2 = half the width and height. Range 1.0 to 5.0. Default 1.0. | |
| straighten | No | Level the horizon. Positive rotates the picture clockwise. The frame zooms in automatically so no empty corners show. Range -45.0 to 45.0. Default 0.0. | |
| perspective_h | No | Positive widens the right side: corrects a subject shot at an angle from the left. Range -100.0 to 100.0. Default 0.0. | |
| perspective_v | No | Keystone correction. Positive widens the top: straightens verticals that converge upward when shooting up at buildings. Range -100.0 to 100.0. Default 0.0. | |
| reset_framing | No | Clear all framing (back to the full, unrotated photo) before applying the given fields. |