# Aspect Ratio Crop Calculator AI Agent Connect

> Aspect Ratio Crop Calculator MCP handles the heavy lifting for geometric calculations. Instead of you manually calculating offsets and scale factors, your AI client determines the exact crop dimensions, scale factors, and fit geometry needed to match any target aspect ratio for your media assets.

## Overview
- **Category:** geometry
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_7zMxKKhAO6yxUXw3DTXYPQcqaVmAd3igjgRdc9jY/ai-agent-connect
- **Tags:** aspect-ratio, crop, scaling, geometry, pixel-math

## Description

Stop guessing pixel coordinates when resizing media. This MCP gives your AI agent the mathematical precision needed to handle complex image and video transformations. Whether you are trying to fit a landscape video into a square social media frame or calculating how to letterbox an image to fit a specific container, this tool provides the exact numbers. You can use it to find the best rectangular area within a source file to satisfy a target ratio, or determine how to scale an image without losing its core composition. It handles the math for scale factors and identifies the specific pixel coordinates of preserved regions. It is a specialized math engine for anyone working with visual assets and coordinate systems.

## Tools

### calculate_crop_geometry
This tool finds the specific rectangular area within a source image that satisfies your target aspect ratio. It calculates the necessary dimensions and offsets to keep the composition correct.

### calculate_fit_geometry
This tool determines how to fit a source image into a target container. It calculates the math for letterboxing or pillarboxing to ensure the image fits the frame.

## Prompt Examples

**Prompt:** 
```
Calculate the crop geometry for a 1920x1080 image to fit a 1:1 aspect ratio, centered.
```

**Response:** 
```
The crop dimensions for a 1:1 ratio from a 1920x1080 source are 1080x1080, with an offsetX of 420 and offsetY of 0.
```

**Prompt:** 
```
What is the scale factor to fit a 100x100 image into a 500x500 container?
```

**Response:** 
```
The scale factor required is 5.0.
```

**Prompt:** 
```
Find the preserved region for a 1000x1000 image cropped to 500x500, centered.
```

**Response:** 
```
The preserved region is defined by the coordinates x1: 250, y1: 250, x2: 750, y2: 750.
```

## Capabilities

### Crop Math
Your agent calculates the exact rectangular area to keep when changing aspect ratios.

### Fit Calculations
The tool determines letterboxing or pillarboxing requirements for fitting images into containers.

### Scaling Logic
Your AI client finds the precise scale factor needed to resize assets.

### Coordinate Mapping
It identifies the specific pixel coordinates for preserved regions during a crop.

## Use Cases

### Social Media Reformatting
Convert landscape video dimensions to square or vertical formats by calculating the center crop.

### UI Component Design
Determine how an image should scale to fit a specific div or container in a web layout.

### Batch Asset Processing
Use an agent to calculate consistent scale factors for a large library of different sized images.

### Coordinate Validation
Verify the exact pixel boundaries of a cropped region to ensure no critical content is lost.

## Benefits

- Eliminates manual pixel math errors.
- Provides exact coordinate data for automated image processing.
- Handles complex letterboxing and pillarboxing logic instantly.

## How It Works

Connect the MCP to your client and start sending geometric requests.

1. Connect your MCP-compatible client to Vinkius.
2. Provide your image or video dimensions to your AI agent.
3. Ask your agent to calculate a crop, scale, or fit requirement.
4. Your agent uses the MCP tools to return precise pixel data.
5. Apply the resulting coordinates or scale factors to your media.

## Frequently Asked Questions

**What can this MCP calculate?**
It calculates crop dimensions, scale factors, fit geometry for letterboxing, and preserved pixel regions.

**Which AI clients can use this MCP?**
Any MCP-compatible client like Claude, Cursor, Windsurf, or VS Code can use this tool.

**Do I need to host the MCP myself?**
No, Vinkius hosts and manages the MCP for you. You connect your client and it is ready to use.

**Can it help with video resizing?**
Yes, it provides the geometric math needed to determine how to crop or fit video frames to new aspect ratios.

**Does it provide pixel coordinates?**
Yes, it can identify the specific x and y coordinates of a preserved region after a crop.

**How do I calculate a crop for a 16:9 ratio?**
You can use the `calculate_crop_geometry` tool by providing your source dimensions and setting the `targetRatioWidth` to 16 and `targetRatioHeight` to 9.

**Can I calculate letterboxing for a video?**
Yes, use the `calculate_fit_geometry` tool to determine the `letterboxWidth` and `letterboxHeight` needed to fit your source into a target container.

**Does this tool handle integer pixel rounding?**
Yes, all calculations are designed to respect integer pixel constraints to ensure valid digital imaging results.
