After coming back from our honeymoon, me and my wife has been going through the photos that we took numerous times. We just miss all the beautiful scenery and building architecture. At first my wife would just go through herself and then I’d join her when I am done checking the forums. I noticed that all the photos were properly rotated even though I’ve taken many photos with the camera in vertical position. She told me that whenever she rotates the photo and then go to the next photo, she will see a small “Saving” message. Then the next time she opens the image, it will stay at the same rotated position.
I immediately stopped her from continue doing that because I remembered when I was using Windows XP, when I rotate and go to the next photo, I get a warning message that says “Because of the dimensions of this picture, rotating it might permanently reduce its quality. Rotating a picture automatically saves it using the original name. To save a backup copy first, see ‘Copy an image’ in Help. Do you want to proceed?”.

I wasn’t really sure at first so I did a test to see if rotating pictures with the built-in photo viewer in Windows will cause any quality loss.
I used a photo that is originally 1MB in size. After rotating 90degrees and closing the image, the file size became 957KB. I tried rotating it back to the original position and file size changes to 969KB. To verify if there are any difference, I used ImageMagick’s compare tool and indeed there were quality loss.
After doing more research on JPEG format, I found out that JPEG file format supports compression, which reduces image size while keeping the image acceptable to the human eye. Unfortunately, to compress images well, the algorithm intentionally loses information. What is saved is NOT the same image as what is in memory; the color of a particular pixel or area of an image will generally will NOT be exactly the same color that was saved. This is particularly true near the edges of objects within the image. Normally this lossy nature of JPEG is not very noticeable. However it can become noticeable when you either load and save a JPEG image multiple times or use a very low quality with a diagram showing sharp color changes.
Now, STOP using Windows XP’s Picture and Fax Viewer, Windows Vista’s Photo Gallery Viewer or Windows 7′s Photo Viewer to rotate your precious digital photos! Once the quality is loss, you can NEVER get it back.
For rotating a JPEG picture without quality loss, you can use any of the programs in this list. There are a total of 81 softwares for you to choose from. One of my personal favorite is called JPEG Lossless Rotator. It is constantly being updated and also free for private non-commercial or educational use, including non-profit organization.
Related posts:
Thanks hugely and also this is why I end up hating Microsoft, they make horrible fucking programs which suck ass and fuck shit up without telling you anything about it.
Whoever made this feature: fuck you and your shit. You are retarded and should be fired from your job!
Yeah, I just finished rotating some fucking pictures which I spent hours taking. And no there is no backups because I did assume this program was done by someone who had brains which actually worked. Fucking retarded dipshit moron monkey coder. FUCK
best thing about it: I was suppose to make panoramic images from them, but now the loss in quality makes all of the images totally worthless
Unfortunately, it’s not quite that simple.
In one sense, the test with Photoshop or similar is excellent. It provides clear feedback regarding whether any _noticeable_ difference is caused by rotation or other re-compression of an image.
In another sense, it still doesn’t really answer the question. After all, JPEG works based on the fact that tiny changes are not noticed by humans.
I wrote a simple program to load two different image files and compare them pixel by pixel, taking into account rotation for one of the image in order to make sure the correct pixels were compared. I then took a number of different-sized pictures, including sizes that are compatible with lossless rotation of JPEGs, copied them, rotated the copies, and then ran them through my program.
In fact, it turns out that the pixels are _not_ preserved exactly. In most cases, the RGB values wound up only off by 1 or 2, often only for one channel (e.g. the red channel might have dropped from 254 to 253, while the other channels remained unchanged). These are changes that are likely imperceptible, whether viewing the image itself or a Photoshop manipulation intended to highlight changes. But they are there.
So, if you want true lossless rotation, don’t use Windows. Use one of the many standalone tools available that do in fact rotate JPEG images without changing the actual data in the image.
Thanks Andre, for the info about lossless rotation in Windows 7, you answered my question!
This Microsoft article on:
Replacing the Windows Picture and Fax Viewer Application Using the Preview Verb
msdn.microsoft.com/en-us/library/bb776833%28VS.85%29.aspx
Should help to replace the default right click rotate in File Explorer with your favorite application. If anybody tried it with the listed by raymond applications, please comment if it worked OK
Windows 7 (unlike XP) appears to rotate JPEGs completely losslessly (assuming the pixel dimensions are suitable, which should be true for any camera-sourced images). The trick to any software that does this to adjust the way that the original compressed data is interpreted for display, rather than decompress, rotate, and recompress the image which will always be lossy.
I rotated/saved/rotated/etc a fairly large JPEG 12 times in Windows 7 Photo Viewer, ending up back at the original orientation. Then I loaded that, along with the original image file, into Photoshop and pasted the adjusted image as a layer on top of the original photo.
Using the ‘Difference’ overlay mode and then flattening the layers gave a pure black result. I checked this using Image>Adjustments>Equalize and there is definitely only one brightness level in the image (black, zero). If there was as much as a pixel different between the two source layers, that would have been visible.
Andre
not sure this is true.
Lossless rotation only works on JPEGS with dimensions divisible by 8. AFAIK WLPG (is that WPV?) rotates losslessly if possible, if not then it’ll do it’s best.
I’d imagine other software works similarly.
Interesting, I never really thought about this before. I think it might be wrong though. Look for factopo to see
Great article!
One typo:
Now, STOP using Windows XP’s Picture and Fax Viewer, Windows Vista’s Photo Gallery Viewer or Windows 7’s Photo Viewer to rotate your precious digital photos! Once the quality is loss, you can NEVER get it back.
It should read ‘lost’, not ‘loss’.
Thanks for the information.
I accidently clicked the box that said to never remind me again. And now I want the warning message back. Do you or anyone know how to get that message back?
Thanks
Val that warning message only shows in Windows XP but not on Vista and 7. However, when you rotate your picture in Vista or 7, there WILL be quality loss.
If you don’t believe me, then go ahead and rotate.
I don’t think this is true for Vista and 7.. This message has never popped up for me.
Andrew, if you actually looked at the list of alternatives he linked, you will notice that both Irfanview and XnView are listed.
lol it cracks me up how anyone can post about lossless jpg transformation without mentioning either IrfanView or XnView. they’re free, tiny, fast, portable and whatnot…etc and are great for viewing/rotating (JPEG) photos losslessly. i used to love XnView, but that was before I discovered IrfanView which was kinda more simple and suits my minimalistic preferences better.
also this is unrelated but some of you may be interested in an insanely fast picture viewer. just google FastPictureViewer and no i don’t work for them. i swear. :)
i hope you’ve learnt something from my post.
thanks ray :D
WB Raymond
how about videos? I’m sure you took some that need to be rotated, how do you rotate them?
You should add MS Paint to the ‘Do not use’ list. ;)
I noticed the loss in quality when using the MS software a while back. From then on I use either Picasa or The GIMP. Especially if you are going to save them in any other format, jpeg, GIF or whatever.
True, you’ll lost quality unless you make a copy of all your pics first once they are on your desktop (or whatever location you want) and start viewing or rotating from there. Your original ones will remain untouched ;)
A very warm welcome back Raymond – to you and your lovely bride.
I look forward to your continued postings and the immeasurable help you give us all. Useful intelligence here and useful tools – thank you.
This is also why, if you’re working on a jpg photo you shouldn’t repeatedly save it — each time you save the photo, it’s further compressed. Admittedly, it’s surprising how many times you can resave a jpg file without noticing it degrade, but it’s still happening and can’t be reversed. Do all the manipulation on a COPY of the file and save it when you’re sure you’re finished.
The other (better) option is to convert it to a lossless format (e.g. PSD, TIFF), do all the adjustments on that (saving it frequently) and then, finally, save it as a jpg.
FWIW, my personal preference for a viewer is FastStone Image Viewer, which rotates losslessly and seems remarkably powerful for such a neat, efficient little program. I’ve used it for years now.
Great advice. Great softwares.
Great to see you back.
What annoys me to no end is that my circa 2002 digital camera had a rotation sensor that rotated the image and saved it in the portrait orientation. So when opened in any image viewer or editor it appeared in the proper orientation.
My newer camera, and all other cameras I’ve seen since that boast an “orientation” sensor still save the image in a landscape format, and just set an EXIF flag which most software doesn’t pay attention to, making it an utterly worthless feature, as then you need to process it with additional software (like those you linked) to get it to display properly.
With a macro, I rotated 100 times a small photo and the degradation is barely visible, with Windows 7.
In Windows XP, photo was destroyed.
Thanks Ray
thanks raymond
Welcome back my dear Raymond. As always you fix my computer problems. Nice to see you online again. Thanks.
Is it good to use ‘Microsoft office picture manager’.
Hi Raymond,
Thanks for sharing this.
Really useful information.
hello,Raymond.
if you used picasa there this problem fixed. Windows Photo Viewer is the worst.
Great post! Thank Raymond!