Rotating images in Windows

Discussion in 'Digital Discussion & Q&A' started by iskoos, Mar 14, 2010.

  1. iskoos
    Offline

    iskoos New Member

    Joined:
    Nov 19, 2009
    Messages:
    187
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Orlando, FL
    Gallery:
    Ratings:
    +2 / 0
    Whenever I try to rotate my images (from landscape to portrait) with window's picture and fax review program, it gives me a warning saying that rotating the image may permanently effect its quality.

    Lately I am not doing it anymore because Canon's ZoomBrowser automatically show the images in portrait mode without rotating it but the question in my mind remains: Would the image quality be really effected if I rotate images with window's picture and fax viewer program?
  2. Josh66
    Offline

    Josh66 Well-Known Member

    Joined:
    Oct 31, 2007
    Messages:
    14,541
    Likes Received:
    1,212
    Trophy Points:
    113
    Location:
    Cedar Hill, Texas
    Gallery:
    Ratings:
    +1,212 / 0
    I haven't noticed any difference.

    I usually do all of that in Lightroom - but occasionally I'll just right-click it in it's folder and rotate that way.

    I've never had any warnings pop up though...
  3. Dwig
    Offline

    Dwig New Member

    Joined:
    Mar 11, 2009
    Messages:
    1,261
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Key West FL
    Gallery:
    Ratings:
    +0 / 0
    Yes. How much depends on the JPEG's quanlity setting.

    As I understand it, neither Windows Preview or Windows Picture & Fax Viewer can edit the JPEGs EXIF data to alter any orientation flag. The rotate the image by rewriting the actual image data. This requires that the JPEG data be recreated. Since JPEG uses a lossy compression as part of its structure any regeneration of the JPEG will cause some loss in quality.

    I generally avoid rotating JPEGs in these viewers. If the original JPEG's quality setting is high the loss can be minimal, but it is still present.
  4. Proteus617
    Offline

    Proteus617 New Member

    Joined:
    Jun 3, 2007
    Messages:
    410
    Likes Received:
    35
    Trophy Points:
    0
    Gallery:
    Ratings:
    +35 / 0
    Rotations of other than 90 deg (or 180 or 270) are always destructive. 90 deg rotations can be loss-less, depending on file type and sophistication of the algorithm used. Rotating a JPG with windows viewer is lossy. You will most likely never notice the difference.
  5. iskoos
    Offline

    iskoos New Member

    Joined:
    Nov 19, 2009
    Messages:
    187
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Orlando, FL
    Gallery:
    Ratings:
    +2 / 0
    Yes, I am sure the loss will be minimal and I will never notice it. But the fact that I will lose something is enough for me to avoid using windows' internal program to rotate my images. I am still rotate some unimportant images but I will not do this for images that are important to me...

    P.S. Windows will not warn you if you click on "Do not show this warning again." message once. This is probably what happened to those who don't see this warning message.
  6. Josh66
    Offline

    Josh66 Well-Known Member

    Joined:
    Oct 31, 2007
    Messages:
    14,541
    Likes Received:
    1,212
    Trophy Points:
    113
    Location:
    Cedar Hill, Texas
    Gallery:
    Ratings:
    +1,212 / 0
    I'm not sure if I have ever checked the 'do not show me again' box or not...

    It is rare that I rotate images outside of Lightroom. Usually, they are not my pictures (pictures from relatives who need to use my computer for whatever reason). I only shoot RAW, and all RAWs get rotated in LR, if required.
  7. airtas
    Offline

    airtas New Member

    Joined:
    Mar 14, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Gallery:
    Ratings:
    +0 / 0
    I was actually wondering this today........I was playing around and of course made copies but some images Windows gave me a warning and others it did not.


    When I would rotate an image the file size went to 1.98 from 1.99

    But when I rotated back it went back to 1.99 mb

    Does that make sense?
  8. Garbz
    Offline

    Garbz New Member

    Joined:
    Oct 26, 2003
    Messages:
    9,712
    Likes Received:
    202
    Trophy Points:
    0
    Location:
    Brisbane, Australia
    Gallery:
    Ratings:
    +202 / 0
    Basically yes. Every time you use a lossy compression you throw away more of the data. Even with identical settings selected by the use each program has a LOT of options selected by the programmer to create a JPEG file. This means that Saving a Quality 12 file in Photoshop will not be the same as setting a 100% quality image in ACDSee, not to mention that the option of selecting even something as basic as quality is not even given in windows picture and fax viewer.

    In that respect, opening an image in Photoshop and then saving it again will have the same effect but at least you are somewhat in control given the quality slider. The less voodoo in your workflow the better.

    To extend: rotating a JPEG in any program is lossy.

    I used to think the same thing. Then I did a quick test. Wrote a script that would open an image save the image, and close the image, rinse repeat for 100 times. JPEG quality was cranked to maximum for the entire time. After a surprisingly small number of saves (5 or so) a significant quality drop was notable. After 10-20 (can't remember the number exactly) the image became outright corrupted.

    Pretty strange for the same algorithm doing the same thing over and over again.

    I assume you mean it went back to 1.98mb. Yes it makes sense. Most algorithms are not directionally agnostic. e.g. a horizontal gradient may compress differently than a vertical gradient. JPEG divides the images into rectangular chunks. The mere act of rotating an image will mean each chunk is occupied by different data.
  9. airtas
    Offline

    airtas New Member

    Joined:
    Mar 14, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Gallery:
    Ratings:
    +0 / 0
    wouldn't the file size shrink though if there is less info in the file?

    I though some programs did lossless rotation
  10. Garbz
    Offline

    Garbz New Member

    Joined:
    Oct 26, 2003
    Messages:
    9,712
    Likes Received:
    202
    Trophy Points:
    0
    Location:
    Brisbane, Australia
    Gallery:
    Ratings:
    +202 / 0
    No. The file size is determined entire by the JPEG settings. You can save an image as a horrible quality 1 JPEG that is tiny, but if you then open it and save it as a quality 12 JPEG again the file size will be huge again despite the original information lost.

    The loss is not introduced in the rotation but in the re-saving. If you open a TIFF file and rotate it in Picture and Fax Viewer it would be lossless too. The other option is simply modifying the rotational bit in the ExIF data. This too is lossless, but it does not result in a re-write of the data. Instead software which is aware of the data will open it and rotate it straight away.

    Example. JPEGs recorded by my camera vertically will have this bit set. If I open the file in an old copy of Picture viewer it will be horizontal. If I open it in Photoshop then the file will be displayed vertical. However if I then click file -> save as and save the file without making any changes to it, the old Picture viewer will see it vertically since photoshop will save it as it sees it. If I do this and save as a TIFF then the rotation was in effect lossless.
  11. airtas
    Offline

    airtas New Member

    Joined:
    Mar 14, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Gallery:
    Ratings:
    +0 / 0
    so windows picture and fax viewer is always bad? not only when it just shows you the warning?
  12. KmH
    Offline

    KmH Helping photographers learn to fish

    Joined:
    Apr 9, 2009
    Messages:
    34,010
    Likes Received:
    4,055
    Trophy Points:
    113
    Location:
    Iowa
    Gallery:
    Ratings:
    +4,060 / 0
    No, JPEG is bad because being a lossey format it discards some measure of image data each time it is saved, no matter what software you use to do the save.
  13. gryphonslair99
    Offline

    gryphonslair99 New Member

    Joined:
    Sep 9, 2006
    Messages:
    6,617
    Likes Received:
    1,140
    Trophy Points:
    0
    Location:
    Wichita, Kansas, USA
    Gallery:
    Ratings:
    +1,140 / 0
    Download this. It's freeware.
  14. Garbz
    Offline

    Garbz New Member

    Joined:
    Oct 26, 2003
    Messages:
    9,712
    Likes Received:
    202
    Trophy Points:
    0
    Location:
    Brisbane, Australia
    Gallery:
    Ratings:
    +202 / 0
    Windows picture and fax viewer is bad when you use it to rotate an image in a lossy format like JPEG.
  15. airtas
    Offline

    airtas New Member

    Joined:
    Mar 14, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Gallery:
    Ratings:
    +0 / 0
    what is you rotate an image that is using meta data flags?
  16. Garbz
    Offline

    Garbz New Member

    Joined:
    Oct 26, 2003
    Messages:
    9,712
    Likes Received:
    202
    Trophy Points:
    0
    Location:
    Brisbane, Australia
    Gallery:
    Ratings:
    +202 / 0
    Do you mean how, or what programs? There are a lot of programs out there that recognise the rotate flag in ExIF. ACDSee, Photoshop, Picasa just to name a few.

    If you mean how, your camera sets a flag in the image to rotate it clockwise or counterclockwise, but saves the image in the standard landscape orientation. Software then should read and adjust when opening.
  17. Lipoly
    Offline

    Lipoly New Member

    Joined:
    May 27, 2010
    Messages:
    145
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    St. Louis
    Gallery:
    Ratings:
    +3 / 0
    (Post resurrection alert)

    FYI: I just did a test in Windows 7, opening an image and rotating it 45 deg 16 times and then used Beyond Compare to compare with the original and they were identical (in addition to them having the same file size). I also did a 400% zoom side-by-side comparison and say no differences.

    It looks like win 7 uses meta data to do rotations in the built-in picture viewer.
  18. Garbz
    Offline

    Garbz New Member

    Joined:
    Oct 26, 2003
    Messages:
    9,712
    Likes Received:
    202
    Trophy Points:
    0
    Location:
    Brisbane, Australia
    Gallery:
    Ratings:
    +202 / 0
    False test. The biggest difference between Windows 7 picture viewer and the earlier versions is that the file is only saved when Windows picture viewer is closed.

    Quick test open a file and rotate it once clockwise, and then close it again. My original was 0.97MB with ExIF orientation data "Upper Left". After I rotated it clockwise and closed Windows 7 picture viewer the result is a file that is 330KB with ExIF orientation data still "Upper Left", and now the ExIF resolution disagrees with the actual file resolution too since that wasn't re-written.

    So Windows 7 Picture Viewer only sucks a little less than it's predecessor, but what is quite good is that it is output colour managed and will recognise not only the working colour space of the image, but also the output space of the monitor.
  19. Lipoly
    Offline

    Lipoly New Member

    Joined:
    May 27, 2010
    Messages:
    145
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    St. Louis
    Gallery:
    Ratings:
    +3 / 0
    I closed it after every rotation...I'm not seeing what you are seeing. There was no change in the picture after 16 rotations (closing and re-saving after each).
  20. Garbz
    Offline

    Garbz New Member

    Joined:
    Oct 26, 2003
    Messages:
    9,712
    Likes Received:
    202
    Trophy Points:
    0
    Location:
    Brisbane, Australia
    Gallery:
    Ratings:
    +202 / 0
    Sure you're working with JPEGs?
    Also try right clicking on an image and clicking "rotate clockwise" and see if the result is the same.
    One more thing you can do to confirm what's going on is check the ExIF data. See if the orientation flag changes.

    I just tried something else to see if another suspicion of mine was right and copied the image, rotated it once, then made another copy of it and rotated it 4 more times to see if the act of a complete rotation after a single window rotation produces the same file as just the single rotation. Result is nope:

    Original: 955KB
    1 CW rotation: 288KB
    3 further CW rotations: 286KB

    The JPEG algorithm also doesn't allow for reproducing the original file. It's simply not possible to open a JPEG and save it and have the data come out exactly as the original did. Even photoshop if you repeat this about 20 times you start getting severe image corruption. (edit apparently some clever algorithms can, photoshop does not use this).

    Either your software is doing something strange (not saving) or your computer is magic :)
    Last edited: Jul 15, 2010

Share This Page