Categories

Image Affine Transformation

Apply affine transformation for scaling, rotation, shearing, and translation

Click to upload file or drag and drop file here

Maximum file size: 10MB Supported formats: image/jpeg, image/png, image/webp, image/gif, image/bmp, image/tiff

Upload any image file (JPEG, PNG, WebP, GIF, BMP, TIFF) for affine transformation

0.1 1.0 10

Horizontal scaling factor (0.1 to 10.0, 1.0 = original size)

0.1 1.0 10

Vertical scaling factor (0.1 to 10.0, 1.0 = original size)

-180 0 180

Rotation angle in degrees (-180 to 180, 0 = no rotation)

-2 0 2

Horizontal shearing factor (-2.0 to 2.0, 0 = no shear)

-2 0 2

Vertical shearing factor (-2.0 to 2.0, 0 = no shear)

-1000 0 1000

Horizontal translation in pixels (-1000 to 1000, 0 = no translation)

-1000 0 1000

Vertical translation in pixels (-1000 to 1000, 0 = no translation)

Background color for transparent areas (hex #RRGGBB or #RRGGBBAA, or color name)

Choose output format or keep original. PNG recommended for transparency

Output quality for lossy formats (JPEG, WebP). Higher = better quality but larger file size

Key Facts

Category
Design
Input Types
file, range, text, select, number
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

The Image Affine Transformation tool allows you to precisely manipulate images by applying geometric operations including scaling, rotation, shearing, and translation. This utility provides a straightforward way to adjust image orientation and dimensions while maintaining control over background settings and output quality.

When to Use

  • Correcting the perspective or orientation of scanned documents or photographs.
  • Resizing and repositioning image assets for consistent layout design.
  • Applying creative geometric distortions like shearing or rotation for graphic projects.

How It Works

  • Upload your image file in any supported format such as PNG, JPEG, or WebP.
  • Adjust the transformation sliders to set your desired scale, rotation angle, shear, and translation values.
  • Specify a background color for empty areas created by the transformation and select your preferred output format.
  • Process the image to download your geometrically transformed file.

Use Cases

Standardizing product photos by rotating and centering them within a fixed frame.
Creating slanted text or graphic effects for web banners using the shear function.
Adjusting the scale and position of icons to fit specific UI design requirements.

Examples

1. Correcting Tilted Scanned Documents

Administrative Assistant
Background
A batch of documents was scanned at a slight angle, making them look unprofessional.
Problem
The documents need to be straightened to align with the page borders.
How to Use
Upload the scanned image and adjust the 'Rotation Angle' slider until the text appears horizontal.
Example Config
angle: -2
Outcome
The document is perfectly leveled, improving readability and presentation.

2. Repositioning Assets for Web Layouts

Web Designer
Background
A product image needs to be shifted to the right and scaled down to fit a specific banner template.
Problem
The original image is too large and centered, leaving no room for text.
How to Use
Apply scaling factors to reduce the size and use translation values to shift the image position.
Example Config
scaleX: 0.8, scaleY: 0.8, translateX: 150
Outcome
The product image is correctly sized and positioned, allowing space for marketing copy.

Try with Samples

image, png, jpg

Related Hubs

FAQ

What image formats are supported?

The tool supports JPEG, PNG, WebP, GIF, BMP, and TIFF files.

Can I make the background transparent?

Yes, by setting the background option to 'transparent' and choosing PNG as your output format.

What is the maximum file size?

You can upload image files up to 10 MB.

How does shearing work?

Shearing shifts the image along the X or Y axis, creating a slanted or tilted effect without changing the image's overall area.

Will I lose quality during transformation?

If you choose JPEG or WebP, you can adjust the quality slider from 1 to 100 to balance file size and visual fidelity.

API Documentation

Request Endpoint

POST /en/api/tools/image-affine

Request Parameters

Parameter Name Type Required Description
imageFile file (Upload required) Yes Upload any image file (JPEG, PNG, WebP, GIF, BMP, TIFF) for affine transformation
scaleX range No Horizontal scaling factor (0.1 to 10.0, 1.0 = original size)
scaleY range No Vertical scaling factor (0.1 to 10.0, 1.0 = original size)
angle range No Rotation angle in degrees (-180 to 180, 0 = no rotation)
shearX range No Horizontal shearing factor (-2.0 to 2.0, 0 = no shear)
shearY range No Vertical shearing factor (-2.0 to 2.0, 0 = no shear)
translateX range No Horizontal translation in pixels (-1000 to 1000, 0 = no translation)
translateY range No Vertical translation in pixels (-1000 to 1000, 0 = no translation)
background text No Background color for transparent areas (hex #RRGGBB or #RRGGBBAA, or color name)
format select No Choose output format or keep original. PNG recommended for transparency
quality number No Output quality for lossy formats (JPEG, WebP). Higher = better quality but larger file size

File type parameters need to be uploaded first via POST /upload/image-affine to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-image-affine": {
      "name": "image-affine",
      "description": "Apply affine transformation for scaling, rotation, shearing, and translation",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=image-affine",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]