Mirror images with a horizontal reflection
While "Flipping" an image just reverses its direction, "Mirroring" involves keeping the original image intact and attaching a newly reversed copy directly next to it to create symmetry.
This means the resulting output image has to be exactly twice as large along the chosen mirrored axis.
If you upload a 1000px wide image and select "Mirror Right", the tool must first create a new HTML5 Canvas that is exactly 2000px wide to hold the result.
drawImage() to paint your original image on the left side (spanning from pixel 0 to 1000).scale(-1, 1) geometric transformation to the canvas context, which tells it to draw everything backwards.drawImage() again to paint the image on the right side (spanning from pixel 1000 to 2000).Because Mirroring mathematically doubles the surface area (and pixel count) of an image, it requires significantly more RAM to execute than a standard crop or flip.
If you mirror a 4K photo, the resulting canvas becomes 8K wide. This is executed using Web Workers to ensure the heavy memory allocation doesn't freeze your browser.
If you upload a 800x600 photo and choose 'Mirror Bottom', what are the dimensions of the final exported image?