Can a JPEG compressed image be rotated without a loss in quality?

后端 未结 10 1549
灰色年华
灰色年华 2020-12-14 01:45

JPEG is a lossy compression scheme, so decompression-manipulation-recompression normally reduces the image quality further for each step. Is it possible to rotate a

相关标签:
10条回答
  • 2020-12-14 02:13

    Unless you rotate by multiples of 90 degrees then your image will have to perform some kind of interpolation which might reduce the quality of your image. Using a good interpolation algorithm will help here.

    As for opening and recompressing, I am not sure you would actually get worse quality, but then I am not sure exactly how JPEG works.

    I suggest you try to compress, manipulate and recompress and see for yourself if the result is good enough. What is good enough is subject to your application.

    0 讨论(0)
  • 2020-12-14 02:15

    There is a program named jpegtran

    jpegtran – a utility for lossless transcoding between different JPEG formats.

    To rotate the image losslessly, you can do the following:

    $ jpegtran -rotate 180 -perfect -outfile rotated.jpg origin.jpg
    

    And Here is a list of applications which provide the JPEG lossless rotation feature based on the IJG code

    0 讨论(0)
  • 2020-12-14 02:16

    If it can help :

    Trying to do better than the Microsoft (Windows 7) native picture viewer and its right-click rotation options, I tried several apps of the following link : http://jpegclub.org/losslessapps.html

    For instance, I tried FastStone Image Viewer, XnView, Photosurfer, JPEG Lossless Rotator, ExifPro Image Viewer.

    NONE of them yields a bigger picture than the basic Windows 7 picture viewer after a simple 90° rotation. It's admittedly limited to conclude so quickly, but I still don't have found a real lossless rotation .jpeg app for the moment, and in any case not better than the built-in Windows one.

    0 讨论(0)
  • 2020-12-14 02:17

    Not a jpg expert, but it seems that the answer would be Yes for 90, 180, 270 degree rotations. (maybe even for 360! :))

    0 讨论(0)
提交回复
热议问题