FileReader API to load the image into the browser's memory without a server. When you click download, it draws the image onto a hidden HTML5 <canvas> element at your specified dimensions, converts that canvas into a Data URL via canvas.toDataURL(), and triggers a download.