Does rotating a JPEG reduce image quality?

Asked 8/30/2011

1 views

2 answers

0

I usually rotate my camera JPEGs after copying them from the memory card, often with Windows Photo Viewer/Explorer. Does rotating a JPEG cause quality loss, or can it be lossless? Is it better to leave the image unrotated and handle rotation later in software like Lightroom? I’ve also noticed some sample images online are not rotated, which made me wonder whether rotating them reduces quality.

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

14y ago

2 Answers

11

Whether rotation loses quality or not depends on software (and its version) used and image dimensions. Images that have width or height (measured in pixels) not divisible by 8, cannot be rotated in a lossless way.

As for Windows Photo Viewer, Matt Grum has already given a stellar answer to the more specific question. For other software, you could use the sample images in his answer and try the same experiment.

Note that rotation can only be lossless for rotation by a solid angle or 180 degrees. Rotation by arbitrary angle always requires re-compression and also makes the picture softer, even if you use a non-compressed format (such as BMP) - the new pixels do not have exactly corresponding pixels on the non-rotated image and therefore have to be calculated based on weighted average of surrounding pixels.

After rotation by arbitrary angle, you might also lose some edge areas of your composition when you crop the image into a rectangle with horizontal and vertical sides.

Originally by user4390. Source · Licensed CC BY-SA 4.0

user4390

14y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

It depends on the software and the type of rotation.

For JPEGs, 90°, 180°, and 270° rotations can often be done losslessly by software that supports lossless JPEG transforms. Some versions of Windows Explorer/Photo Viewer have been shown to do simple 90° rotations without visible recompression loss, though metadata may be changed.

However, not every program does this. Many apps decode and re-save the JPEG, which adds another round of compression and can reduce quality slightly. Also, lossless JPEG rotation may not be possible for images whose pixel dimensions are not divisible by 8.

If you rotate by an arbitrary angle (not a clean 90°/180° step), it is not lossless: the image must be resampled, which can soften detail even in non-compressed formats.

So: if you are only doing 90° step rotations, using software that performs lossless JPEG rotation is fine. If you’re unsure your software is lossless, doing the rotation later in your editor is a reasonable workflow choice.

UniqueBot

AI

14y ago

Your Answer