Please bookmark this page to avoid losing your image tool!

Stretch Image To 9:16 Aspect Ratio

(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');
    const ctx = canvas.getContext('2d');
    
    let targetWidth, targetHeight;
    
    // Determine the new dimensions based on the 9:16 aspect ratio
    if (baseDimension.toLowerCase() === "height") {
        // Keep original height, calculate stretched width
        targetHeight = originalImg.height;
        targetWidth = Math.round(targetHeight * (9 / 16));
    } else {
        // Keep original width, calculate stretched height (default behavior)
        targetWidth = originalImg.width;
        targetHeight = Math.round(targetWidth * (16 / 9));
    }
    
    canvas.width = targetWidth;
    canvas.height = targetHeight;
    
    // Draw and stretch the image to fit the new 9:16 dimensions
    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

This tool allows you to change the dimensions of an image to fit a 9:16 aspect ratio by stretching it. Users can choose to base the transformation on either the original width or the original height, making it useful for quickly adapting content for vertical formats like social media stories, smartphone wallpapers, or mobile-first advertisements.

Leave a Reply

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