const img = document.querySelector('img') const tempImg = new Image() tempImg.src = 'https://masoprofit.cz/storage/images/1600x2000/41847.png.webp' tempImg.decode().then(() => { img.src = tempImg.src }).catch(e => { console.log(e) })