JPEG Rotation And Lossless Editing In iOS

JPEG Rotation And Lossless Editing In iOS

A JPG rotated 900 times. Who says digital files don't rot?

Back up your photos. Always shoot in RAW. After a while all the good advice starts to sound like the adults speaking in Charlie Brown cartoons. Wah-wah-wah-wahwahwah.

Especially now iCloud manages our backups and our iPhones only shoot JPGs.

But one piece of advice is still worth listening to: “always rotate JPGs losslessly.” What?

The image above shows a JPG that has been rotated 2000 times. Or, more specifically, it shows the original plus the 900th rotation, in the middle of a 2000-rotation marathon by Wikipedian Burny. The 200th image is nothing but colored noise.

Fortunately, if you use your iPhone to take your photos (and who doesn’t these days) then you’re safe, at least if you use the built-in apps. The iPhone stores JPG orientation info as a flag set in the photo’s metadata. Thus, it is stored as shot, and not even rotated until you view it. This means that the JPG is not touched until you open in elsewhere and start mashing it up in editing apps. It’s also why iPhone photo thumbnails sometimes show up 90-degrees off in some apps – they’re not reading the EXIF data properly before displaying the picture.

More good news: if you make edits in the camera or photos apps, then these edits (even the crops and enhancements) are made losslessly, and the edits are stored in “XMP” sidecar files. This is what allows you to revert edits made in the Photos app on your iDevice at any time in the future. IPhoto for iOS will even send these files along with the images when you “beam” them to other iPhoto users.

Fortunately, every photo editing app on iOS will save a new file of your tweaked photo, as they’re not permitted to do anything but read from (and add new photos to) your camera roll. This can fill up a small 16GB iPhone pretty fast, but its a lot better than ending up with the picture at the top of this post.

Related
  • outy1812

    There is a line in the bash script on the Wikipedian page for the above user, that is actively setting the quality of the rotation to 85 :

    convert GenerationLoss_step$i.jpg -rotate 90 -quality 85 GenerationLoss_step$(($i+1)).jpg

    Surely this means the rotation aspect is irrelevant?? What it’s saying is that if you open an image and decrease the quality by 15 several times, the quality of the image is reduced. Well durr!

    The script is doing exactly what the coder is telling it to – setting quality to 50 would have required less steps. Or a quality of 1…

About the author

Charlie Sorrel Charlie Sorrel is the Reviews Editor here on Cult of Mac. Follow Charlie  on Twitter at @mistercharlie.

(sorry, you need Javascript to see this e-mail address)| Read more posts by .

Posted in News | Tagged: , , , , , , , , |