A clear answer. Here’s how.
Extends the canvas by twice the horizontal/vertical padding and places the original decoded image at that offset. Padding is transparent or filled with the chosen colour. Source pixels are not resized. Output remains capped at 4 million pixels; background colour is ignored for transparent padding. Supports PNG/JPEG/WebP up to 10 MB and 4 million decoded pixels per file. Browser decoding and single-frame PNG re-encoding remove source metadata/colour profiles; no files leave this device.