belun.app Blog
RU

How to Rotate an Image Without Losing Quality

Why phone photos come out sideways, what a rotation does to your pixels, and how to straighten a crooked horizon in the browser without uploading anything.

Photographer rotating a photo on a laptop screen while editing images at a desk

The photo looks fine on your phone. You email it to someone, or upload it to a shop listing, and it arrives lying on its side. Nothing was corrupted. The file never actually changed orientation in the first place.

Phone cameras save the frame the way the sensor read it, then write a small EXIF field called Orientation to say “turn this by 90° before showing it.” Value 6 means a quarter turn clockwise, value 3 means upside down, and so on through eight possible values. Your gallery app reads that field. So does every modern browser. Plenty of other software does not: older CMS uploaders, some print services, a fair number of desktop viewers, and most image-processing scripts that nobody updated. They show the raw pixels and ignore the note attached to them. (The same EXIF block is where your GPS coordinates live, which is why the EXIF Metadata Remover exists as a separate step.)

The fix is to stop relying on the note. Rotate the pixels themselves, and the picture reads correctly everywhere. That’s what the Rotate / Flip Image tool does — in your browser, with nothing uploaded.

Quarter turns are free, odd angles are not

A 90°, 180°, or 270° rotation is just bookkeeping. Every pixel moves to a new coordinate, but it keeps its exact value — the pixel that was at (0, 0) lands at (height-1, 0) and that’s the whole operation. No interpolation, no softening.

Rotate by 7° and the arithmetic changes completely. Pixels now land between grid positions, so each output pixel has to be averaged from several input pixels. Fine detail goes slightly soft, text edges get a little fuzzy, and a hard diagonal line picks up faint stair-stepping. One pass is barely noticeable on a photo. Three passes at 2° each is visibly worse than one pass at 6°, which is a good argument for getting the angle right before you save.

There’s a second tax if you export as JPEG: the format re-compresses from scratch every time. Rotate, save, decide it’s 1° off, rotate again, save again, and you’ve run the image through two lossy encodes. When you’re experimenting, save intermediate steps as PNG, and switch to JPEG only on the version you’re keeping.

Your canvas gets bigger at an angle

Turn a rectangle off-axis and its bounding box grows. A 4000 × 3000 photo rotated 5° needs a 4246 × 3337 canvas to contain it, and the four corners of that canvas are empty — the original picture is sitting inside it on a tilt.

Something has to go in those triangles. PNG and WebP can leave them transparent. JPEG can’t, so it fills them with whatever colour you pick, white by default. The tool shows a corner-fill control as soon as your angle stops being a multiple of 90, and the preview is the real output canvas, so the gaps are visible before you download.

Most of the time you don’t want the gaps at all. Straighten first, then run the result through the Image Cropper and trim inward until only real photo remains. You lose a thin border — that’s the cost of straightening, and there’s no way around it.

Flip is not rotate

They get confused constantly, and the difference matters. A 180° rotation turns the image upside down; a horizontal flip mirrors it left-to-right. Both leave a portrait looking “wrong,” but only the flip reverses the content. Any text in the frame comes out backwards, a watch ends up on the other wrist, and a scanned document becomes unreadable.

Mirroring is the right call for a webcam selfie that came out reversed, or a sprite sheet where you need the character facing the other way. It’s the wrong call for a photo that’s merely upside down.

One detail worth knowing: in this tool, flips mirror what’s on screen rather than the original pixel grid. After a 90° turn, “flip horizontally” still mirrors left-to-right in the preview, the way a desktop editor behaves. Tools that apply the flip to the untouched image instead will surprise you by mirroring vertically.

Straightening a crooked horizon

Hand-held shots drift. A sea horizon off by 1.5° is obvious to the eye even when you can’t name what’s wrong.

Drag the angle slider in small steps and watch the horizon against the edge of the preview frame. Corrections usually land between 0.5° and 3°; if you need more than 5°, check whether the shot was tilted deliberately. Release the slider near a quarter turn and it snaps to exactly 90, so you won’t accidentally save at 89.5°.

The keyboard is faster once the image is loaded: [ and ] for quarter turns, H and V for the two flips, 0 to throw it all away and start over.

Fix the orientation once

Drop a photo into the Rotate / Flip Image tool, turn it until it looks right, and download. The rotation is baked into the pixels, so it stays fixed in every uploader and viewer you send it to — and the file itself never left your machine.

Try the tool

Rotate / Flip Image →