Image Custom Matrix

Apply custom 2x2 transformation matrix to images. Input any four matrix values [a, b; c, d] to create unique transformations. Great for learning linear algebra and image processing.

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 custom matrix transformation

Top-left value of the 2×2 transformation matrix (affects X scaling and rotation)

Top-right value of the 2×2 transformation matrix (affects X shear and rotation)

Bottom-left value of the 2×2 transformation matrix (affects Y shear and rotation)

Bottom-right value of the 2×2 transformation matrix (affects Y scaling and rotation)

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
Images, Audio & Video
Input Types
file, number, text, select
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

The Image Custom Matrix tool allows you to apply precise 2x2 linear transformations to your images by defining custom matrix values. By adjusting the four matrix coefficients, you can perform scaling, shearing, and rotation effects, making it an ideal utility for image processing experiments and educational demonstrations of linear algebra.

When to Use

  • When you need to perform specific geometric transformations like scaling or shearing on an image.
  • When you are studying linear algebra and want to visualize how 2x2 matrices affect coordinate spaces.
  • When you need to apply custom mathematical distortions to visual assets for creative or technical projects.

How It Works

  • Upload your source image in any supported format like PNG, JPEG, or WebP.
  • Input your desired values for the four matrix positions (m00, m01, m10, m11) to define the transformation.
  • Optionally set a background color for transparent areas and choose your preferred output format and quality.
  • Process the image to generate the transformed result based on your custom matrix parameters.

Use Cases

Creating custom geometric distortions for artistic image effects.
Demonstrating the impact of matrix multiplication on coordinate systems in a classroom setting.
Batch-processing images with specific scaling or shearing requirements for technical layouts.

Examples

1. Horizontal Scaling Transformation

Graphic Design Student
Background
A student needs to demonstrate how a matrix can stretch an image horizontally without changing its height.
Problem
Manually calculating the transformation to stretch the image width by 2x.
How to Use
Upload the image and set the m00 value to 2.0, while keeping m01 and m10 at 0.0 and m11 at 1.0.
Example Config
m00: 2.0, m01: 0.0, m10: 0.0, m11: 1.0
Outcome
The image is rendered with its width doubled while maintaining its original height.

2. Applying a Shear Effect

Digital Artist
Background
The artist wants to create a slanted, skewed look for a logo to give it a sense of motion.
Problem
Applying a consistent shear effect to the image geometry.
How to Use
Upload the logo, set m01 to 0.5 to introduce horizontal shear, and keep other values at identity matrix defaults.
Example Config
m00: 1.0, m01: 0.5, m10: 0.0, m11: 1.0
Outcome
The logo appears slanted to the right, creating a dynamic, speed-oriented visual effect.

Try with Samples

image, png, jpg

Related Hubs

FAQ

What does the 2x2 matrix control?

The matrix values control linear transformations: m00 and m11 affect scaling, while m01 and m10 control shearing and rotation components.

Can I use this for transparency?

Yes, you can set a background color or keep it transparent, and we recommend using PNG as the output format to preserve alpha channels.

What image formats are supported?

You can upload JPEG, PNG, WebP, GIF, BMP, and TIFF files.

How do I ensure high quality output?

For lossy formats like JPEG or WebP, you can adjust the quality slider up to 100 for the best visual fidelity.

Is this tool suitable for educational purposes?

Absolutely, it is designed to help users visualize the practical application of linear algebra and matrix math on digital images.

API Documentation

Request Endpoint

POST /en/api/tools/image-custom-matrix

Request Parameters

Parameter Name Type Required Description
imageFile file (Upload required) Yes Upload any image file (JPEG, PNG, WebP, GIF, BMP, TIFF) for custom matrix transformation
m00 number Yes Top-left value of the 2×2 transformation matrix (affects X scaling and rotation)
m01 number Yes Top-right value of the 2×2 transformation matrix (affects X shear and rotation)
m10 number Yes Bottom-left value of the 2×2 transformation matrix (affects Y shear and rotation)
m11 number Yes Bottom-right value of the 2×2 transformation matrix (affects Y scaling and rotation)
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-custom-matrix 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-custom-matrix": {
      "name": "image-custom-matrix",
      "description": "Apply custom 2x2 transformation matrix to images. Input any four matrix values [a, b; c, d] to create unique transformations. Great for learning linear algebra and image processing.",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=image-custom-matrix",
      "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]