Please bookmark this page to avoid losing your image tool!

Batch Image Format Normalizer And Resizer To 120×1024 Converter

(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, resizeMode = "pad", bgColor = "#ffffff", quality = 0.92) {
    // Requirements exact dimensions: 120 x 1024
    const TARGET_WIDTH = 120;
    const TARGET_HEIGHT = 1024;
    
    const canvas = document.createElement('canvas');
    canvas.width = TARGET_WIDTH;
    canvas.height = TARGET_HEIGHT;
    const ctx = canvas.getContext('2d');
    
    // Fill the background (JPEG does not support transparency)
    ctx.fillStyle = String(bgColor);
    ctx.fillRect(0, 0, TARGET_WIDTH, TARGET_HEIGHT);
    
    const imgW = originalImg.naturalWidth || originalImg.width;
    const imgH = originalImg.naturalHeight || originalImg.height;
    
    if (imgW > 0 && imgH > 0) {
        let scale;
        // Determine scaling based on the resize mode
        if (String(resizeMode).toLowerCase() === 'crop') {
            // Scale to fill the entire area, clipping any overflow
            scale = Math.max(TARGET_WIDTH / imgW, TARGET_HEIGHT / imgH);
        } else {
            // Default to 'pad': Scale to fit entirely inside the area uniformly
            scale = Math.min(TARGET_WIDTH / imgW, TARGET_HEIGHT / imgH);
        }
        
        const dw = imgW * scale;
        const dh = imgH * scale;
        const dx = (TARGET_WIDTH - dw) / 2;
        const dy = (TARGET_HEIGHT - dh) / 2;
        
        // High quality rendering
        ctx.imageSmoothingEnabled = true;
        ctx.imageSmoothingQuality = 'high';
        
        ctx.drawImage(originalImg, dx, dy, dw, dh);
    }
    
    // Normalize output format to explicitly be a high-quality JPEG
    const numericQuality = Math.max(0, Math.min(1, Number(quality) || 0.92));
    const dataUrl = canvas.toDataURL('image/jpeg', numericQuality);
    
    // Return an Image element containing the converted jpeg data
    const outImg = new Image();
    outImg.width = TARGET_WIDTH;
    outImg.height = TARGET_HEIGHT;
    outImg.src = dataUrl;
    outImg.style.display = 'block';
    outImg.style.maxWidth = '100%';    
    
    return outImg;
}

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 batch process images to a standardized size of 120×1024 pixels and convert them into high-quality JPEG format. It offers flexible resizing options, such as ‘pad’ to fit the entire image within the dimensions with a customizable background color, or ‘crop’ to fill the entire area. This is particularly useful for developers or designers needing to normalize a collection of images for specific web layouts, sidebars, or mobile application assets that require strict dimension consistency.

Leave a Reply

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