Flip Image

Horizontal or vertical mirror, drawn on a canvas.

Result
Output
—

Worked example

Front cameras save an unmirrored image but the preview is mirrored, which is why selfies often look "wrong" compared to what you saw. A horizontal flip restores the preview view.

Mirroring is done by scaling the canvas by −1 on one axis and translating to compensate. Without the translate, the image draws off-canvas and the output is blank — a mistake that produces a silent empty result rather than an error.

Horizontal versus vertical

Horizontal is a mirror: text becomes unreadable, faces look like the person you know from photographs. Vertical is a flip: useful for correcting upside-down scans and reflections in water.