Únete a nosotros registrándote gratis para usarlo!
Arrastra y suelta una imagen WebP aquí o escoge una usando el botón
let webpImageFile = null; function handleFiles(files) { if (files.length > 0) { webpImageFile = files[0]; } } function convertToPNG() { if (!webpImageFile) { alert(‘Por favor, selecciona una imagen WebP primero.’); return; } const reader = new FileReader(); reader.onload = function(event) { const img = new Image(); img.onload = function() { const canvas = document.getElementById(‘canvas’); canvas.width = img.width; canvas.height = img.height; const ctx = canvas.getContext(‘2d’); ctx.drawImage(img, 0, 0); const pngUrl = canvas.toDataURL(‘image/png’); const link = document.createElement(‘a’); link.href = pngUrl; link.download = ‘imagen_convertida.png’; link.click(); } img.src = event.target.result; } reader.readAsDataURL(webpImageFile); }