Page 1 of 1

lossless JPEG transformations

Posted: 2015-12-20T15:42:15-07:00
by gheineiii
Is it correct to assume that rotating a JPEG image by 90 or 180 degrees ("convert -rotate 180") or flipping to a mirror image ("convert -flip") involve only the transposition of pixels, and therefore involve no loss in image quality ? Thank you, and kindly forgive the naivete of this question ...

Re: lossless JPEG transformations

Posted: 2015-12-20T17:21:49-07:00
by fmw42
I believe that is correct, except for JPG or any image that has lossy compression, because it needs to be decompressed and compressed even for 90 rotation increments.

Re: lossless JPEG transformations

Posted: 2015-12-20T18:43:00-07:00
by glennrp
ImageMagick recompresses the image even when simply flipping, flopping, or copying a JPEG. There are other applications that do it losslessly, without recompressing, such as the "jpegtran" application that comes with the JPEG library.

Re: lossless JPEG transformations

Posted: 2015-12-22T11:27:13-07:00
by gheineiii
Thank you for the information! It turns out that the the Debian package "libjpeg-turbo-progs", including "jpegtran", is already installed on my system (Ubuntu 14.04) -- possiblly included as a depency to imagemagick. Currently working with some films scanned into JPG; some of the scans were mis-oriented, or the wrong side of the film was scanned. Converting the images using jpegtran will be a lot easier than digging up the films and re-scanning.