Sun Oct 10, 2010
I was just wondering how to do lossless rotation of images in Ubuntu. The default viewer, Eye Of Gnome, is supposed to do that. According to the help file, “1.4 … All modifications made in JPEG images are lossless. That is, saving rotated and flipped JPEG images will not recompress the image”. But this information is not clearly stated in the program menus. I wanted to be sure it is actually lossless before rotating hundreds of images. To find out I did this:
- Find a JPEG image in the File Browser, duplicate it pressing CTRL+C and CTRL+V.
- Click (select) one of the images, press SPACE to launch EOG, rotate the image, then do File > Save.
- Now we have to find out if the image was re-compressed or not. I open both images in Gimp.
- Rotate one of them to match the rotation of the other. This rotation inside Gimp is lossless, because no compression is taking place.
- Place both images as layers of the same document. Now I have two apparently identical images in two layers, one on top, one on bottom.
- Set the Mode of the top layer to Difference. The image becomes black. If it was perfect black it would mean the images are identical and transformation was lossless indeed. Let’s find out.
- Flatten the image.
- Change Levels, dragging the white point triangle from right to left, next to the black point. This brings up details in what was previously black.
- The result is the image above, which is obviously not pure black. Somehow the transformation was NOT lossless. Does anyone know what went wrong?