lossless JPEG transformations

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
gheineiii
Posts: 6
Joined: 2015-01-06T07:44:02-07:00
Authentication code: 6789

lossless JPEG transformations

Post 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 ...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: lossless JPEG transformations

Post 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.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: lossless JPEG transformations

Post 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.
gheineiii
Posts: 6
Joined: 2015-01-06T07:44:02-07:00
Authentication code: 6789

Re: lossless JPEG transformations

Post 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.
Post Reply