Bulk Image Resizer

Bulk Image Resizer

🔓 Click to Lock Aspect Ratio
Processing… Please wait
Preview
`; document.getElementById('preview-container').appendChild(div); } function removeImage(btn) { const index = Array.from(btn.parentElement.parentElement.children) .indexOf(btn.parentElement); images.splice(index, 1); btn.parentElement.remove(); } // Aspect ratio locking document.getElementById('lock-ratio').addEventListener('click', () => { lockAspectRatio = !lockAspectRatio; document.getElementById('lock-ratio').textContent = lockAspectRatio ? '🔒 Aspect Ratio Locked' : '🔓 Click to Lock Aspect Ratio'; if (lockAspectRatio && images.length > 0) { const img = new Image(); img.onload = () => { originalAspectRatio = img.naturalWidth / img.naturalHeight; }; img.src = images[0].src; } }); // Dimension synchronization function updateDimensions(changed) { if (!lockAspectRatio || !originalAspectRatio) return; const widthInput = document.getElementById('width'); const heightInput = document.getElementById('height'); if (changed === 'width') { heightInput.value = Math.round(widthInput.value / originalAspectRatio); } else { widthInput.value = Math.round(heightInput.value * originalAspectRatio); } } document.getElementById('width').addEventListener('input', () => updateDimensions('width')); document.getElementById('height').addEventListener('input', () => updateDimensions('height')); // Main processing function async function processImages() { if (images.length === 0) { alert('Please upload images first!'); return; } const loading = document.getElementById('loading'); const fileInfo = document.getElementById('file-info'); loading.style.display = 'block'; fileInfo.textContent = ''; try { const zip = new JSZip(); const width = parseInt(document.getElementById('width').value); const height = parseInt(document.getElementById('height').value); const quality = parseInt(document.getElementById('quality').value) / 100; const format = document.getElementById('format').value; for (let i = 0; i < images.length; i++) { const resizedImage = await resizeImage( images[i].src, width, height, quality, format ); const fileName = `${format}-${width}x${height}-${images[i].name}`; zip.file(fileName, resizedImage, {binary: true}); } const content = await zip.generateAsync({type: 'blob'}); const url = URL.createObjectURL(content); const link = document.createElement('a'); link.href = url; link.download = `resized-images-${Date.now()}.zip`; link.click(); fileInfo.textContent = `Processed ${images.length} files successfully!`; } catch (error) { alert('Error processing images: ' + error.message); } finally { loading.style.display = 'none'; } } function resizeImage(src, width, height, quality, format) { return new Promise((resolve, reject) => { const img = new Image(); img.onload = () => { const canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height; const ctx = canvas.getContext('2d'); ctx.drawImage(img, 0, 0, width, height); canvas.toBlob(blob => { resolve(blob); }, `image/${format}`, quality); }; img.onerror = reject; img.src = src; }); } // Drag and drop handling document.addEventListener('dragover', e => { e.preventDefault(); document.querySelector('.upload-section').style.borderColor = '#3b82f6'; }); document.addEventListener('dragleave', () => { document.querySelector('.upload-section').style.borderColor = '#cbd5e0'; }); document.addEventListener('drop', e => { e.preventDefault(); document.querySelector('.upload-section').style.borderColor = '#cbd5e0'; const files = e.dataTransfer.files; if (files.length > 0) { document.getElementById('file-input').files = files; handleFileSelect({ target: document.getElementById('file-input') }); } });

Bulk Image Resizer: Description

The Bulk Image Resizer is a robust, browser-based tool designed to resize and optimize multiple images simultaneously. Tailored for photographers, web developers, and content creators, it streamlines batch processing while maintaining privacy and control. Ideal for large-scale projects, this tool ensures consistent results across image collections without compromising quality.


Key Features

  1. Batch Processing
    • Resize unlimited images in one session.
    • ZIP archive download for organized bulk exports.
    • Preserves original filenames for easy identification.
  2. Precise Resizing Controls
    • Custom width/height inputs (in pixels).
    • Aspect ratio locking (toggleable via 🔒).
    • Quality adjustment slider (1–100%).
  3. Format Flexibility
    • Convert images to JPEG or PNG.
    • Supports input formats: JPEG, PNG, WEBP.
  4. Client-Side Security
    • Zero server uploads—processing occurs locally.
    • No data retention or privacy risks.
  5. User-Friendly Interface
    • Drag-and-drop uploads with thumbnail previews.
    • Remove individual images before processing.
    • Real-time feedback and progress indicators.

How It Works

  1. Upload Images
    Drag and drop files or select via file dialog (supports 100+ images).
  2. Adjust Settings
    Set dimensions, lock aspect ratio, choose output format/quality.
  3. Process & Download
    Click once to resize all images and download as a ZIP archive.

Scroll to Top