Please bookmark this page to avoid losing your image tool!

Aspect Ratio 2.55:1 DVD And TV Video Formatter

(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, mode = 'letterbox', backgroundColor = '#000000', aspectRatio = 2.55) {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');
    
    // Parse the aspect ratio to ensure it's a number
    const targetRatio = parseFloat(aspectRatio) || 2.55;
    
    const sw = originalImg.width;
    const sh = originalImg.height;
    const srcRatio = sw / sh;
    
    let cw, ch;
    
    // Determine canvas dimensions based on mode and ratios
    if (mode === 'crop') {
        // Crop the image to fill the 2.55:1 aspect ratio completely
        if (srcRatio < targetRatio) {
            // Image is narrower than target, crop top and bottom
            cw = sw;
            ch = sw / targetRatio;
        } else {
            // Image is wider than target, crop left and right
            cw = sh * targetRatio;
            ch = sh;
        }
    } else {
        // Default to 'letterbox': padding the image to fit the 2.55:1 frame completely
        if (srcRatio < targetRatio) {
            // Image is narrower than target, pillarbox (pad left and right)
            cw = sh * targetRatio;
            ch = sh;
        } else {
            // Image is wider than target, letterbox (pad top and bottom)
            cw = sw;
            ch = sw / targetRatio;
        }
    }
    
    // Set actual canvas dimensions, rounded to nearest whole pixel
    canvas.width = Math.max(1, Math.round(cw));
    canvas.height = Math.max(1, Math.round(ch));
    
    // Fill background for letterbox padding
    ctx.fillStyle = backgroundColor;
    ctx.fillRect(0, 0, canvas.width, canvas.height);
    
    // Calculate offsets to draw the image centered
    const offsetX = (canvas.width - sw) / 2;
    const offsetY = (canvas.height - sh) / 2;
    
    // Draw original image on the new 2.55:1 formatted canvas
    ctx.drawImage(originalImg, offsetX, offsetY, sw, sh);
    
    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 users to reformat images to a 2.55:1 aspect ratio, which is a cinematic standard often used in film and video production. Users can choose between two formatting modes: ‘letterbox’, which pads the image with a customizable background color to fit the ratio without losing any part of the original image, or ‘crop’, which scales and trims the image to fill the entire 2.55:1 frame. This utility is useful for filmmakers, video editors, and hobbyists looking to prepare stills or assets for widescreen cinematic displays, DVD formats, or specific television video standards.

Leave a Reply

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