Return to Digital Photography Articles
Digicams and Lossless Rotation
Unfortunately, there are a number of digital cameras that use standard resolutions that are not well suited for JPEG lossless rotation. This page identifies some of these exceptions.
Lossless Rotation and Partial MCUs
For relevant background material, please have a look at JPEG compression, JPEG minimum coded unit (MCU) and lossless rotation with partial MCU. In general, lossless image rotation requires image dimensions to be integer multiples of 16 pixels for it to work.
Digicams with Bad Resolution Sizes
There are several digicams on the market today that have selected output resolutions that will make lossless rotation impossible to achieve (when using JPEG mode). The following tables identify some of these violators.
Digicams with Partial MCU
Surprisingly, there are a few cameras that produce images with resolutions that aren't integer multiples of the 8x8 pixel MCUs!
Unfortunately, this will practically guarantee that lossless image rotation will not be possible, as the luminance component is never subsampled and requires 8 pixels to complete a minimum coded unit (JPEG image tile).
I am unsure why the digital camera manufacturers didn't seem to take this into account before selecting the output image dimensions. The CMOS or CCD sensor's real image resolution is generally cut down slightly to create a resulting effective resolution (the trimmed off space can be used for noise removal or just a cleaner edge). Therefore, the loss of an additional 4 or 8 pixels in one image dimension would seem to be preferrable than to create an image that doesn't completely fill the JPEG MCU. By not using an integer multiple of the MCU dimension, image encoders and decoders will always have some uncertainty in how these edge pixels should be handled.
|Aspect Ratio||Camera Make|
|6.133||3042x2016||3:2 ~||Fuji (SLR)|
It is interesting to note that some digicam manufacturers have apparently realized the problem that these partial MCU cause and modified the image dimensions slightly between models. An example of this is Kodak, where one model uses 2580x1932 and another uses 2576x1932 (a difference of only 4 pixels!).
Digicams with Problems due to Chroma Subsampling
Chroma subsampling is used in nearly all digital cameras (usually 2x1, but sometimes 2x2 in cheaper cameras). One of the repercussions of chroma subsampling is that it effectively makes the Minimum Coded Unit (MCU) 16 pixels instead of 8. The following digicams have at least one image dimension that is an integer multiples of 8x8 pixels, but not 16x16 pixels.
From the perspective of Windows Picture and Fax Viewer, lossless rotation is not possible. However, these photos can be easily rotated losslessly by utilities such as IrfanView or jpegtran, BetterJPEG and other similar programs.
During image rotation, the chroma subsampling "orientation" should also be rotated. In other words: if an image originally had 2x1 chroma subsampling (horizontal axis), then after rotation by 90 or 270 degrees, the resulting subsampling will be 1x2 (i.e. on the vertical axis).
For example: let's take a photo that is 2272x1704 with the standard 2x1 chroma subsampling. When the image is compressed using JPEG compression, the luminance (brightness information) uses the full resolution of 2272x1704, but the chrominance (color information) is first reduced to 1136x1704 before compression. In this example, both the luminance and chrominance have dimensions that are integer multiples of 8x8 (284x213 and 142x213 tiles/MCUs respectively). Therefore, there should be nothing preventing lossless image rotation from being performed.
It is unclear why Windows XP Explorer and Windows Picture and Fax Viewer cannot handle lossless rotation of images that fall in this category, as it certainly is possible. As a result, users will be faced with the message shown below.
Strangely enough, I have observed that when Windows attempts to rotate images that in this category, the resulting photo has a chroma subsampling of 2x2. This likely explains the reason why it believes that lossless rotation is not possible. If it applies 2x2 chroma subsampling, then there will in fact be a dimension of the chrominance channel that has partial MCUs! To me this appears to be a bug and/or bad assumption on the part of Microsoft.
"Because of the dimensions of this picture, rotating it might permanently reduce its quality."
Take this as a warning NOT to rotate the image with Windows, and instead use a different program! The image degradation can be quite significant.
|Aspect Ratio||Camera Make|
|6.088||3032x2008||3:2 ~||Kodak (SLR)|
|6.040||3008x2008||3:2 ~||Sigma, Pentax, Samsung|
|5.039||2592x1944||4:3||Canon, Fuji, Kokak, Nikon, Sony, Olympus, Pentax, Samsung|
|3.871||2272x1704||4:3||Canon, Fuji, Konica Minolta, Nikon, Sony, Nikon, Olympus, Panasonic, Samsung|
In the above tables, a tilde (~) indicates that the image aspect ratio is not exactly 3:2 (1.500) or 4:3 (1.333).
Corruption from Rotation
If you did perform a non-lossless (lossy) rotation with Windows XP Explorer or Windows Picture and Fax Viewer, you will unfortunately suffer image degradation across the entire image area, not just on the outer peripheral edges. It is not smart enough to truncate the partial tiles and do a lossless transform, or handle images with partial . The actual amount of image degradation can be quite significant, easily visible in an un-enhanced difference overlay in Photoshop.
Missing your digicam?
The above lists were extracted from hundreds of digital cameras that I have examined that provide an image resolution over 3 megapixels. If you see the Windows XP rotation warning (shown above) from your image and it is not an image dimension shown above, please leave a comment below. Similarly, if you have images from your digital camera with an image dimension shown above, but Windows XP doesn't give you such a warning, I would be interested to hear it!