Please bookmark this page to avoid losing your image tool!

Image Aspect Ratio 20:9 Stretch Tool

(Free & Supports Bulk Upload)

Drag & drop your images here or

The result will appear here...
You can edit the below JavaScript code to customize the image tool.
function processImage(originalImg, baseDimension = 'width') {
    const canvas = document.createElement('canvas');
    let targetWidth, targetHeight;

    // Determine the new dimensions to enforce a 20:9 aspect ratio
    if (baseDimension.toLowerCase() === 'height') {
        targetHeight = originalImg.height;
        targetWidth = Math.round(targetHeight * (20 / 9));
    } else {
        // Default to using the original width as the base
        targetWidth = originalImg.width;
        targetHeight = Math.round(targetWidth * (9 / 20));
    }

    canvas.width = targetWidth;
    canvas.height = targetHeight;

    const ctx = canvas.getContext('2d');
    
    // Drawing the image to the new dimensions will automatically stretch it
    // ignoring its original aspect ratio.
    ctx.drawImage(originalImg, 0, 0, targetWidth, targetHeight);

    return canvas;
}

Free Image Tool Creator

Can't find the image tool you're looking for?
Create one based on your own needs now!

Description

The Image Aspect Ratio 20:9 Stretch Tool allows users to modify an image to fit a specific 20:9 aspect ratio. By choosing to base the transformation on either the image’s original width or height, the tool stretches the image to match the target dimensions. This utility is useful for creators needing to quickly format content for specific mobile device displays, digital signage, or cinematic-style aspect ratios where precise dimension stretching is required.

Leave a Reply

Your email address will not be published. Required fields are marked *