In Picasa2, Is Rotating A Vertical JPEG Image Lossy Or Lossless?

Discussion in 'Digital Cameras' started by Morton Linder, Sep 18, 2005.

  1. Hi,

    I have several types of image software, and seem to prefer Picasa2 for
    my simple needs. Picasa2 maintains the original image with all its
    pixels (5 million in my case), and edited pix can have the editing undone.

    My question is this: If I rotate a vertical JPEG image to make it stand
    up on screen, is this rotation process lossy or lossless? Knowing the
    correct answer will allow me to decide how to maintain my vertical images.

    Thank you.

    Morton Linder, Sep 18, 2005
    1. Advertisements

  2. Morton Linder

    JohnR66 Guest

    I can not see the reason why any programmer would want or need to change the
    values stored in the memory representing a pixel location when the image is
    rotated 90 Deg. because the pixel is moving relative its neighbor. No
    advanced algorithm is needed. But don't take my word for it.

    Also, JPEG is a file compression standard. When the file is open, the
    operations performed on the image is independent of the file type.

    JohnR66, Sep 18, 2005
    1. Advertisements

  3. Thanks for your reply. In a different image software, (I forgot which),
    when clicking on to rotate an image there is an on-screen warning that
    carrying out the rotation will permanently deteriorate the image.
    Therefore, I want to be certain one way or the other, before I rotate
    all my vertical images.
    Morton Linder, Sep 18, 2005
  4. Morton Linder

    Jukka Aho Guest

    Can't say for sure, but Picasa does not seem to appear on this
    list of applications implementing lossless JPEG rotation:
    Jukka Aho, Sep 18, 2005
  5. Morton Linder

    Jukka Aho Guest

    The point is specifically that the OP wants to rotate images that are in
    JPEG format.

    If rotated the conventional way - by opening the JPEG file in an image
    editor, rotating it, then saving it as a JPEG file again, the image has
    now been through _two_ lossy JPEG compression cycles: one in the camera
    and another one when saving after rotation.

    However, a special algorithm exists that allows rotating (and mirroring)
    JPEG images in a lossless fashion, without subjecting the image to
    another compression cycle. For this to work, a JPEG-specific rotation
    functionality needs to be implemented.

    On the following web page, there is a list of programs that implement
    this kind of lossless JPEG rotation:


    You might also want to see this page:

    Jukka Aho, Sep 18, 2005
  6. Morton Linder

    Joan Guest

    I haven't used Picasa at all. The list on the Sylvana site includes
    Irfanview, so I just tried a rotation in it and then saved the file. There
    was a save options dialog box for me to make some choices. I would have
    thought if the rotation were lossless that a dialog box wouldn't be
    necessary. I gave up on Irfanview.

    Then I copied some original files taken yesterday on my CP5700 to a scratch
    I opened the lame Nikon PictureProject, which is not listed on the Sylvana
    site, and imported these files. I rotated one of them, which was instant
    and then checked in Windows Explorer. PictureProject saves the change
    without asking! The original file in it's original directory is 1757184
    bytes and the rotated file is 1753088 bytes.

    I opened both the original and the rotated file in Photoshop enlarged them
    both to 300% then rotated back the rotated image.

    I can't see any difference.
    Joan, Sep 18, 2005
  7. Joan wrote:
    A small file change in file size is possible, with the rotation still
    being lossless.
    Better to do image arithmetic, and subtract the two images to make a
    difference image. Using something like "Count number of image colours"
    ensure that the difference image has just one colour.

    David J Taylor, Sep 18, 2005
  8. Morton Linder

    Onno Voors Guest

    How did you rotate it? It seems that you didn not use the lossless rotation
    option (Options > Jpeg lossless rotation).
    Onno Voors, Sep 18, 2005
  9. why not first save it in a lossless form, e.g. .psd, do your
    manipulation, THEN save ir as .jpg.?
    mike o'sullivan, Sep 18, 2005
  10. Morton Linder

    Jukka Aho Guest

    Supposing there's nothing to edit in the image (besides fixing the
    orientation), that'll still give him yet another (lossy) compression
    cycle, whereas using a lossless JPEG rotation algorithm won't.
    Jukka Aho, Sep 18, 2005
  11. Hi Morton,
    I have Picasa 2 installed and checked your query.
    On a bush scene which was 5119 kb in the folder was the same size when
    exported from Picasa 2 as landscape (original format) and 5414 kb when
    rotated and exported.

    As I understand how Picasa 2 works all the modification details done
    on the original file are stored in the "ProcessmultipleFiles.Txt" file
    stored in the same folder as the designated picture file. The original
    file is not modified in any way.

    However when a picture is exported the modifications are then done.

    Hope this makes sense
    Allan & Glennis Sheppard, Sep 18, 2005
  12. Thanks to all for the helpful replies. They are all appreciated.

    Morton Linder, Sep 19, 2005
  13. Would it do that? I always save my pix in psd format before doing any
    adjustments. Do you mean that the mere act of saving as psd causes
    information loss?
    mike o'sullivan, Sep 19, 2005
  14. Morton Linder

    Joan Guest

    Onno, I didn't know about those options. I still get a jpeg options window
    when saving, though.
    Joan, Sep 19, 2005
  15. Morton Linder

    Jack Guest

    [posted and mailed]

    Since no one gave you a simple yes or no answer, I will tell you that
    rotating photos in Picasa2 is definitely lossless. Any changes you make
    in Picasa are only made in Picasa. The original photo image is
    Jack, Sep 19, 2005
  16. Morton Linder

    HornBlower Guest

    Its lossless because it only happens inside of Picasa. If you view your
    images in another browser they will not be rotated. So your original image
    wasn't touched by Picasa.
    HornBlower, Sep 19, 2005
  17. Morton Linder

    Onno Voors Guest

    (Please reply underneath the text you're quoting)

    It is not necessary to go through the save file procedure, after you have
    used the lossless rotation. The picture has already been saved rotated.
    Onno Voors, Sep 19, 2005
  18. No, there's no loss as long as the image remains in PSD format. But
    supposed you ultimately want a JPEG output image? To convert from your
    PSD to a new JPEG, the image will undergo a JPEG compression step which
    is lossy. This is in addition to the original in-camera JPEG
    compression, so your final image data has undergone two JPEG
    compression steps.

    In comparison, if all you want to do is rotate the image, a lossless
    JPEG rotation merely re-arranges the coefficient data in the JPEG file
    *without* any further loss. The result has been compressed only once,
    not twice.

    On the other hand, if you keep the image in PSD or TIFF format always,
    never generating a new JPEG, there's no advantage.

    Dave Martindale, Sep 19, 2005
  19. Morton Linder

    Jukka Aho Guest

    The problem is not the "saving in psd format" part of the procedure, but
    the "saving in jpeg format" part. (See the above comments again.)

    When using an image viewer/manipulator that has a lossless JPEG rotation
    algorithm (such as XnView), the original JPEG file and the rotated JPEG
    file share identical quality - nothing was lost in the process; the
    original image data inside the file was just rearranged.

    When using an image viewer/manipulator that does _not_ have a lossless
    JPEG rotation algorithm, the on-screen rotation itself is lossless, but
    saving back to JPEG format isn't. That's the difference.

    * * *

    To put it in another way, lossless JPEG rotation algorithms operate
    directly on the (already-compressed) JPEG data. They know how the JPEG
    images are constructed and how the data is stored inside the file. That
    allows them to do their rotation or mirroring magic without invoking
    another lossy decompression-compression cycle.

    Traditional (non-JPEG-aware) image rotation tools, however, do not know
    anything about the internals of the JPEG format, but insist of
    decompressing the JPEG image first, then rotating, and finally
    recompressing the rotated data back to JPEG format again. In this
    process, information is lost. (Lossless JPEG rotation algorithms bypass
    this decompression-recompression cycle entirely.)
    Jukka Aho, Sep 19, 2005
  20. Morton Linder

    Joan Guest

    Interesting. I hadn't looked.
    The image rotated in Irfanview became about 4K smaller and the image rotated
    in PictureProject became about 4K larger. Both images were similar in that
    they were landscapes with bushes in the foreground then water and then sky.
    Joan, Sep 20, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.