40

This is most likely caused by entropy coding, which is the final lossless stage of JPEG compression, after the image data has been quantized to reduce its size. When a JPEG image is losslessly rotated, this final lossless encoding layer must be undone, the unpacked DCT coefficients shuffled around, and then the shuffled coefficients need to be entropy coded ...


25

I went ahead and repeated the experiment to see if I could figure out what's going on. Procedure I generated a random 256-by-256 pixel RGB image using the "Solid Noise" filter in GIMP (Filters > Render > Clouds > Solid Noise...) using the default settings (shown below): And the result: Then I saved the image as a JPEG using the default settings: Then I ...


20

EDIT: This answer was posted before I knew that the files had increased in size by around 9 KiB (9055 bytes for the 256×256 image, 9612 KiB for the 512×512 image). In all likelihood, when you first rotated the image, Windows Picture Viewer did one (or both) of the following things: Added an EXIF tag that was not in the original JPEG image (perhaps the ...


12

You can use cross-platform open source software jhead, with the options jhead -autorot *.jpg Which losslessly rotates the images based on the embedded rotation flag (and removes that flag, of course.


9

One way to rotate a photo losslessly (without decoding/reencoding) it to change the EXIF data that specifies the rotation (this data is set by the camera, depending on its orientation when the picture was talken). This can be done with ExifTool: exiftool -n -Orientation={n} TheImage.jpg Where {n} is a number between 1 and 8 (some of these orientations are ...


5

The command line program jpegtran can losslessly rotate JPEGs on Linux. From the command line: jpegtran -rotate 90 MyJpeg.jpg > MyJpegRotated.jpg If you don't have jpegtran program installed, you can install it in Ubuntu with: sudo aptitude install libjpeg-progs A similar tool is exiftran, which can determine orientation from the EXIF tags: exiftran ...


5

It is possible and even trivial but I am not aware of any application to do that task specifically. There reason why the file size changes when rotated is that TIFF files are encoded losslessly as one would compress a stream of pixels components from one corner of the image to the opposite one. If you consider Run-Length-Encoding (RLE) which a common TIFF ...


5

As far as I know the answer is no, roll/pitch data is not recorded in EXIF data. I have a 60D which also offers a "digital level" or "artificial horizon" when composing a shot but this information is not preserved in the output EXIF data. There's a good site here with comprehensive information about standard EXIF data and parameters, and there are pages with ...


4

Since more then ten years I use exiftran to rotate images after getting them from the camera. Is this step still needed today? Yes. Don't browsers and other image apps rotate the image correctly without running exiftran on the files. No. As stated by @junkyardsparkle: I personally still experience occasional pain from discovering that the actual ...


4

Some companies choose to render such images on computer instead of actually photographing and composing then in an animation. If we are to talk ONLY about photographic processes, one would place the object on a rotating plate. The rotation of the plate should be controllable on a degree level. Then start photographing. Initial position, Photo 1 Rotate a ...


4

Duplicate of this StackOverflow question exiftool -all:all= -tagsfromfile @ -exif:Orientation /path/to/files -all:all= removes all data, then Orientation is copied back into the file with the -TagsFromFile option. Do not run this command on RAW files (NEF/ARW/CR2, see Exiftool FAQ #8). This command creates backup files. Add -overwrite_original to suppress ...


4

You can't actually rotate any file. You only can rotate images, then save those images to a file. But it is usually not possible to write (in the sense of changing the sensor data) RAW files; it would be possible theoretically, of course (your camera does it), but no software i'm aware of does it, not even the proprietary ones of the camera manufacturers. ...


3

In the Lightroom filter bar, you can filter by aspect ratio. Select "Portrait" or "Landscape", depending on which images you want to change, then select all photos displayed (Ctrl-A) and rotate them.


3

For years I have used ACDSee to perform lossless JPEG rotation, very handy and fast. Recently I discovered that Windows (7) Explorer has a (Right-Click) Rotate Clockwise and Rotate Counterclockwise item that I put to the test. I copied a JPEG image, then rotated it clockwise 4 times, then counterclockwise 4 times, then back and forth 4 more times. The ...


3

In current Linux Mint you should have had Image Magick installed. Use the -auto-orient option. convert -auto-orient source.jpg target.jpg Note: This operation isn't lossless but you can combine it with other conversion options like -resize (if you do them).


3

Without reverse engineering the jpeg en/decoder it's impossible to say for sure. There are actually a number of jpeg standards and contrary to popular belief, not all of them can be modified without re-encoding. It's possible that the first save is a lossy rewrite into its favoured jpeg flavour and the subsequent rotations are a simple metadata tweak or ...


3

Simple: rotation is a JPEG property, and some image editors and viewers understand it, while others are dumb and just display all images starting from the top left. Your camera is setting this based on the camera's detected orientation, but not all of the programs you are using care. You can use a utility like jhead or jpegtran to apply the rotation ...


3

IrfanView can indeed rotate JPEG images in a lossless way, and it indeed needs the JPG_TRANSFORM plugin to do that. Luckily that plugin is already included in a normal install of IrfanView. To check you have the plugin: go to Help -> Installed PlugIns and check if JPG_TRANSFORM.DLL is in the list. The JPG_TRANSFORM plugin is available for both 32 and 64 bit ...


2

The JPEG algorithm uses a combination of lossy and lossless steps. The algorithm breaks up an image into 8x8 blocks, known as Minimum Coding Units (MCU). If an image has dimensions that are not divisible by 8, MCUs along the right and bottom edges are padded. Each MCU is then processed through FFT/DCT (Fast Fourier Transform/Discrete Cosine Transform) and ...


2

XMP is what you're looking for, now an ISO standard it is no longer vendor specific to Adobe. XMP files are where Adobe Camera Raw stores its data on crop and rotation options for example. Plus, XMP is usually implemented as a 'sidecar' file so absolutely no changes to the source file are made, allowing for unlimited changes without loss of data. The '...


2

The Hugin panorama stitcher can be used to align pictures. The align_image_stack executable is part of Hugin and can be run as a standalone command line program. To align pictures im1.tif im2.tif, im3.tif,..., you can give the command align_image_stack -a al -C -t 0.3 -c 20 im1.tif im2.tif im2.tif .... which will output the remapped aligned pictures al0000....


2

The reason for the error is probably that the photo dimensions (2150, 3226) are not multiples of 8. Then a jpeg photo cannot be rotated totally lossless. Why it's complaining about the 65500 pixels is probably just a bug. What camera saves such dimensions, usually they always do 8x8 blocks? I have gThumb 3.4.4.1 on Ubuntu 17.04, and there is a rotate ...


1

I've marked @Grimaldi's answer as the answer to my question, but I still want to explicitly quote the section of the referenced article that has the exact answer I want: In other words, we would have to achieve an 8 arc minute (or better) accuracy on both axes to achieve an 11.25’ overall maximum polar alignment error. Plugging this value into ...


1

A misalignment of 1'' leads to a drift of 0.23''/min when the telescope is pointing to the Zenit. See here (in german) Have a look at these formulas here


1

Lossless JPEG rotation is only possible without introduction of boundary artifacts if the image dimensions are multiples of the block size (typically[/always?] 8). See the jpegtran man page (sorry I don't have a good canonical link for it; feel free to edit if you find one) for details on what's involved: The transpose transformation has no restrictions ...


1

Unfortunately, the only way to know for sure whether a digital picture frame will automatically rotate images for you is to try it. To avoid problems, you can rotate your images prior to copying them to the frame for display. exiftran can losslessly rotate images based on the Exif orientation tag: exiftran -abip *.jpg jhead also uses the Exif orientation ...


1

If the two images are only similar, but not taken from exactly the same place, you might want to just stick with a similar cropping, as any control-point based transform might distort your image in strange ways. If you need to adjust rotation relative to the original image, you can load it as a background image in gimp (up or downscaling to your new image as ...


1

Either that or Lightroom is writing the images rotated in the correct orientation, but leaving the EXIF tags in place, causing software to rotate it wrong. I would check what LR is writing using EXIFTool, and depending on what you see, look for options you can change in Lightroom to turn on or off exporting of whichever EXIF tags are at issue.


1

Unfortunately it sounds as if the gravity sensor that determines orientation is faulty. If this is the case, the camera will need repair to resolve your issue. In Canon cameras, I believe that sensor is in the viewfinder prism housing. The sensor could be dirty, or it's possible it (or some other component in the camera) has gotten magnetized, causing it ...


Only top voted, non community-wiki answers of a minimum length are eligible