Digital Image Rotation: Why and how.
The issue of digital image orientation and post-process image rotation is as old as digital photography itself and applies to all digital photo cameras or smartphones in general. The digital image technology advanced tremendously over the past two decades since it became available in the mid-nineties, but we still need to pay attention with respect to the image orientation and there are some ‘gotchas’ to look out for.
Digital image rotation basically breaks down into three issues:
- Digital image file aspect ratio
- Digital image rotation process and tools
- Digital image time and date stamp
The following discussion of these topics applies generally to any type of digital photo usage, whether posting it in a blog or using it in a document or viewing on a computer or tablet, but our main focus is to display the photos in a digital photo frame.
Image file aspect ratio
Every digital image consists of ‘pixels’, which are individual dots that compose an image and each has a certain color (simplified explanation – read more about digital images here). The more pixels, the better the resolution. Images are two-dimensional, means there is a certain number of pixels in horizontal and vertical direction. Generally speaking, if there are more pixels in horizontal direction than vertical, we consider the image to be ‘landscape’ oriented; If the vertical direction consists of more pixels than horizontal, we assume to have a portrait-oriented photo.
So far the theory. Reality is slightly different. Based on the assumption above, is this photo in landscape or portrait orientation?
Looking at the image (as a cognitive human being), we clearly see it is taken in portrait orientation (although it is tipped to the side). Being a computer – or digital photo frame – all we see is more pixels in horizontal direction than vertical, means it clearly is in landscape orientation. No?
Ok, this is exactly where the issue is.
Every digital camera has an image sensor to capture the photo. This sensor has a certain x-y resolution, with normally x (horizontal) being larger than y (vertical). Most cameras are in the 4:3 (x:y) or 5:4 range. All is fine if we actually take a photo in landscape orientation. Once we tip the camera 90 degrees to the left or right (aka portrait orientation), thigs become interesting:
The sensor format did not change. So the image taken is still ‘wider’ than ‘high’, although the image content isn’t. So what we – as cognitive humans – have to do is to look at the image and rotate it on our computer to put it in the right orientation. There are great tools for this, see next chapters. But smart cameras or phones have orientation sensors build in: Although the digital image is still wider than high, there is a piece of information attached to the image file which says if it was taken in portrait orientation (and at what angle). This piece of information is part of the image EXIF data (read more about EXIF – Exchangeable image file format – here). So with this data, non-humans (computers, tablets, digital photo frames, …) can rotate the image in the correct orientation without recognizing the image content. The downside is that not all devices set this orientation flag, and not all digital image formats support it, which makes the rotation process inconsistent.
So let’s get to work and look into digital image rotation tools and options:
Image rotation process and tools
As we have just learned, our safest bet is to keep a (human) eye on the orientation. But for the actual rotation, there are various tools that help us to do the job.
Once we identified photos that show in the wrong orientation, we need to rotate them. Microsoft Windows has a built-in image rotation function… which we discourage you to use. The reason for this ‘warning’ is described in the next chapter. So what to look out for in an image rotation tool?
First, the rotation must be ‘lossless‘ (means, the quality of the image does not suffer in the rotation process). This statement specifically applies to JPEG images, the most commonly used image format for digital photos. JPEG is a compressed image format (to reduce the image data size and optimize storage memory usage). Other formats – especially bitmap based image formats like BMP or PNG – do not have this problem as they are not compressed (but have other drawbacks like not supporting EXIF information).
Second, when rotating an image, you want to maintain the ‘image taken’ timestamp of the file. That is important to keep the images in the chronological order of capturing, not rotation. Unfortunately, this is not always given:
Image time and date stamp
So what about that time stamp? The moment an image is born (aka you take a photo on your camera), the camera creates the image file and also adds two time stamps as image properties: ‘Created’ and ‘Modified’ date and time – which are the same at this point (simply the moment the picture was taken).
Now, fast forward to today, you browse the impressive collection of photos you have taken during that vacation and spot multiple photos that show in the wrong orientation. The solution seems to be easy: A simple right click in your Windows explorer offers you to rotate the image clock- or counter-clockwise. Great. The wakeup call comes once you present the digital image version of your vacation… First, the audience will see all landscape oriented photos (from leaving the house to getting back home), then all portrait oriented photos – from start to end. Why? Unfortunately, Windows decided to change the ‘created’ (picture taken) timestamp to the moment of rotation, overwriting the time the picture was actually taken. Why they have chosen to do this is beyond our knowledge (this behavior started with Windows 7), but at least we know how to get around this:
Use a free tool, which will rotate your photos lossless, using the EXIF orientation information, and maintaining the time stamp. Best of all worlds. Simple as can be.
Here’s our pick:
Our favorite tool is the JPEG Lossless Rotator from Anny Studio. This tool integrates in your Windows Explorer shell context menu – you can simply rotate an image left or right by right-clicking on it or use the auto-rotate option for images with EXIF orientation information. If you right-click folders (instead of individual files), you have the option to automatically batch rotate all images in that folder based on the EXIF tag.
Using this tool, you’re able to rotate your digital images
- automatically using the EXIF information while
- maintaining the original timestamp (select “Keep File Timestamp” in the settings)
Another fairly simple tool that gets the job done properly is JPEG Autorotate.
Now go out, take beautiful pictures, take care of the proper orientation in a click, and enjoy them on the most beautiful, real wood digital photo frames of the world, PixelPerfectFrames™.