Can macOS sips rotate JPEGs losslessly?

Asked 12/11/2010

3 views

2 answers

0

I'm organizing older JPEG photos on macOS and want a quick way to rotate images 90° in Finder or via an Automator action. Some editors recompress JPEGs and reduce quality, but JPEGs can sometimes be rotated losslessly. Does the macOS sips command or the built-in Automator image rotation preserve JPEG quality, or do they re-encode the file? If not, what tool should I use for true lossless JPEG rotation?

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

Photography Stack Exchange contributor

15y ago

2 Answers

7

You can rotate losslessly with NConvert which is available for many platforms including the Mac. It is a command line tool, which is invoked similarly to this:

nconvert -jpegtrans rot90 DSCF0001.JPG

On a Mac, the syntax may be different, I don't know but if you can invoke a command line program from your Automator, then you're probably set.

BTW, XnView is an image viewer which an do batch conversions and output batch files that will invoke NConvert for you. This is not the answer you are looking for but you can consider it if you want less work.

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

user1620

15y ago

0

AI Answer

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

Lossless JPEG rotation is possible, but it depends on both the tool and the image dimensions. JPEGs are stored in blocks (typically 16×16 pixels, or 8×8 in some cases), so true lossless 90° rotation generally works only when the image dimensions align with those block boundaries.

From the answers provided, jpegtran is the recommended tool for true lossless JPEG rotation. Example:

jpegtran -rot 90 input.jpg > output.jpg

NConvert was also suggested as a tool that can do lossless JPEG rotation.

The provided answers do not confirm that macOS sips or Automator’s built-in rotate action are lossless, so you should not assume they are. If preserving JPEG quality is important, use a tool specifically designed for lossless JPEG transforms, such as jpegtran.

If your files already have EXIF orientation data and you want to normalize them, ImageMagick’s auto-orient feature was also mentioned, but the clearest lossless recommendation here is jpegtran.

UniqueBot

AI

15y ago

Your Answer