Why You should rotate your Jpeg photos losslessy

JPEG is argumentatively the most popular image formats uses for digital photography. It is so because compression they use which results in an impressive reduction of file size which makes it appropriate where size matters particularly where storage media is costly or small like in the case of digital cameras and for the use on the internet where bandwidth may be slow or costly. Now that we are in the age where speed is everything, waiting too long for a web page to download because of huge image may cause your visitors to move away to somewhere else.

Of course now, professional digital cameras do offer saving photos in the RAW format but that would result in about 10x the space needed to store a typical jpeg photo. RAW format has its purpose where quality is everything.

However, all these space saving comes at a cost. JPEG uses a lossy compression algorithm which effectively drops details which it may deem unnecessary. For instance if the background is of one color, instead of saving hundreds of thousands of pixels details, it does not need to store all the duplicate details. However in doing so, some finer details may be dropped especially when the compression level is increased.

Because the JPEG compression algorithm is constantly deciding to drop pixels, even a simple task of saving an photo over and over again after an edit or a rotation may result in greater degrading of the photo quality.

With that in mind, what we attempted to do in our application is to first load the jpg photos in the native operating system format, typically in the bitmap format without compression and thereby perform all the necessary edits and adjustments before saving the photos in the format of your choosing. Thus what happens is that the original JPEG photo will not be the same JPEG photo which is saved. Of course all the EXIF headers and relevant details will be saved. As the original files is not the same as the file saved, you may noticed that the file size either being higher or lower than the original file.

Our Batch JPEG Rotator application is unique as it offers lossless jpeg rotation. It can do this because it basically does one thing and that’s photo rotation. Although the JPEG photo still uses the de facto lossless compression algorithm, what Batch JPEG Rotator is able to do is during an image rotation, it breaks down a photo to its separate pixels and move them in its new place. No image quality is affected in the process. A pixel is like a piece of lego block which when assembled together makes up an photo. Say if there is 1000 such pixels and when you rotate a photo from landscape to portrait orientation, it will move the pixels into place. No pixels are left out and none added into the mix.

batchjpegrotator2

Of course there may be a slight change in file size as we will need to modify the EXIF header to reflect the new photo orientation and also to embed a thumbnail representation of the photo into the header for use by Windows to speed up loading thumbnails.

In Batch JPEG Rotator, what makes it unique is that it supports EXIF orientation. All modern digital camera now embeds photo orientation details in each jpeg photo taken although the actual photo itself is saved as landscape. Some applications do use this EXIF orientation to determine how the photos should be rotated when being viewed. It works fine and good except that not all web browser will support EXIF orientation and the photos may not come out in the right orientation. That’s where Batch JPEG Rotator comes into play. By enabling the EXIF Orientation support, each photo loaded will be evaluated to determine whether it needs to be rotated and if so, which orientation would need to be applied.

It does also support Standard Rotation mode which means that you can adjust the JPEG Quality and Smoothing settings. When the JPEG Quality is set lower, you may see pixelization forming around the edges of the photos particularly between the transition between one color to the next. Smoothing just helps to apply a level of blurring to smooth out those edges to soften it. Too high a level of smoothing would also result in a blur image. Typically between 1 to 5% and not more than 15% JPEG smoothing should be applied. JPEG Quality of between 75 to 80% would typically yield the best Quality vs File Size ratio. It may take some experimentation to determine what’s best.

We would love to offer lossless jpeg rotation to all our applications but it gets complicated as they offer a varied amount of different settings options which would change the photos details drastically.

Leave a Reply

*