Sat, Feb 8, 11:25 PM CST

Renderosity Forums / Photography



Welcome to the Photography Forum

Forum Moderators: wheatpenny Forum Coordinators: Anim8dtoon

Photography F.A.Q (Last Updated: 2025 Feb 03 6:38 am)



Subject: Lossless JPG Rotation


hendrikm ( ) posted Tue, 31 December 2002 at 6:33 AM · edited Wed, 14 August 2024 at 1:35 AM

Hi everyone, I know this has nothing to do with photography in the first place, but I thought maybe one of you has stumbled upon a software which can rotate jpg-images without compressing them again and thus lowering the quality. Ive read about this kind of software, but a quick search on download.com got no result. Thanks and happy new year!


tasquah ( ) posted Tue, 31 December 2002 at 7:51 AM

What about working with it in another format then only converting it when you are done ? Thats what most people I know do. Beside I do not really have that much degredation or loss with adobe 7.0 photo shop but i tend to work in higher res untill i am finished with it. The only time i have a problum like what I think your talking about is a photo has been compressed to fast in one lump and not in smaller increments like it should be. Or I could be wrong so just ignore me .


peterke ( ) posted Tue, 31 December 2002 at 8:03 AM

Attached Link: http://www.acdsystems.com/English/index.htm

PhotoCanvas Lite, which comes with Acdsee v. 5.0 has the ability to do a lossles JPEG rotation. Check out this link. I consider this software essential for managing my photo's. However, I always make a backup of the originals because any operation on a digital photo is likely to result in undesirable information loss (in my case, the loss of the PIM - data).


Michelle A. ( ) posted Tue, 31 December 2002 at 9:10 AM

Tasquah's idea certainly makes the most sense.....

I am, therefore I create.......
--- michelleamarante.com


tasquah ( ) posted Tue, 31 December 2002 at 9:35 AM

Speaking of digital photos There is a adobe product out at a resonable cost that is a modified version of photoshop called "Photoshop Elements 2.0 ". I use it at work sometimes for all the digital cameras people have and cant figure out how to upload them to there own computers . Of course they all want the photos turned the right way and adjusted and croped ..... I can say that i see any noticable loss in quality like i do with some other products.


Misha883 ( ) posted Tue, 31 December 2002 at 10:34 AM

Ah! I think I see what you are asking: if the digital camera stores as a JPEG, then landscape and portrait shots will all be uploaded as horizontal format. Having to rotate one (or the other) to correct for this ordinarily requires re-compressing with JPEG, with more loss. Seems like there "should" be a solution for this... Maybe try peterke's link?


Michelle A. ( ) posted Tue, 31 December 2002 at 10:41 AM

Hmmm.....depending on the resolution choosen in camera the images could be jpgs or tiffs....when I save my images in camera as jpgs I use the camera's software to convert to tiffs as they are being saved to the hard drive...then there is no concerns regarding re-compression.

I am, therefore I create.......
--- michelleamarante.com


zhounder ( ) posted Tue, 31 December 2002 at 12:01 PM

My camera also saves in JPEG. I do have the option to save as TIFF also but that sucks up memory cards left and right. I bring my original JPEGs into Photoshop then save them as either TIFFs or PSDs for manipulation. I save the originals exactly as they are and try to never actually work with those originals. The Tiff/PSD copies are what I manipulate. That way I have the originals to go back to if I need too. Also Photoshop allows you to set the level of compression for JPEGs. You can actually save them with no compression at all and that will actually INCREASE the size of the file. I cleaned up a few JPEG to TIFFS I had and got them printed in 8x10 for presents this year. The Photo proccessing place I use prefers TIFFs and he also uses MAC where I us a PC. They came out great too! Photoshop still seems like the program of choice for me! Magick Michael


Misha883 ( ) posted Tue, 31 December 2002 at 2:30 PM

Attached Link: http://jpegclub.org/losslessapps.html

Such interesting questions on this forum! [And excuses for me not to fold the laundry...] I did a little research, and found this (unsubstantiated) quote: "There are a few specialized operations that can be done on a JPEG file without decompressing it, and thus without incurring the generational loss that you'd normally get from loading and re-saving the image in a regular image editor. In particular it is possible to do 90-degree rotations and flips losslessly, if the image dimensions are a multiple of the file's block size (typically 16x16, 16x8, or 8x8 pixels for color JPEGs). This fact used to be just an academic curiosity, but it has assumed practical importance recently because many users of digital cameras would like to be able to rotate their images from landscape to portrait format without incurring loss --- and practically all digicams that produce JPEG files produce images of the right dimensions for these operations to work. So software that can do lossless JPEG transforms has started to pop up. Bu tyou do need special software; rotating the image in a regular image editor won't be lossless." The link goes to a bunch of applications designed to do the rotation. But, (assuming Minolta knew what they were doing), Michelle's method should also work, as the rotation in the camera *should* be lossless. So, the next thing enquiring minds wanted to know, does Photoshop (v7) handle JPEG rotation correctly? I ran some experiments below:


Misha883 ( ) posted Tue, 31 December 2002 at 2:39 PM

file_38858.jpg

With some help from my little friend Sargum, I started with a 288X288 pixel file, converted it to a low quality JPEG, and rotated it four times (saving each time), to get back to the original orientation. This is a large amount of abuse! Normally, we would not subject photos to such things. However, Photoshop does pretty well. The initial JPEG has little error, and the error only increases by a small amount during the four rotations. Any additional error is not objectionable. However, the error does increase some; a rotation is not totally lossless! More about this later...


Misha883 ( ) posted Tue, 31 December 2002 at 2:45 PM

file_38859.jpg

The above example used a 288X288 pixel image, which is an integer multiple of 16X16. Here I repeat the same test using a 300X300 pixel image, NOT an integer multiple. This time, the initial JPEG still looks very good. But the four rotations intriduce considerable visible error. Photoshop, or any software, will not handle this amount of abuse well when the image size is not an integer multiple of 16X16.


Misha883 ( ) posted Tue, 31 December 2002 at 2:52 PM

file_38860.jpg

Since Photoshop (v7) did pretty well on an image with integer multiples of 16, but not perfect, one wonders just exactly what is going on??? Comparing the "before" and "after" JPEG's, and greatly enhancing the difference, looks pretty cool. I'll have to use this for something someday. [If hendrik or peter ever try some of the special lossless software, I'd like so see a similar comparison.]


tasquah ( ) posted Tue, 31 December 2002 at 7:08 PM

WOWY !! Misha883 great job . I do visually see the difference were the photo was'nt a multible of 16. And it does make more sence to me now, than it did before and i will have to keep reminding myself to rotate first before i crop photos. This is one of the reasons I dont use PSP or recomend it . All algorythms are not the same. It must be a cleaner number for 16 for some reason . What compression number did you use ? like a 3 or 4 ?


starshuffler ( ) posted Wed, 01 January 2003 at 2:12 AM

This is very interesting info, Misha! (This sounds like good material for an article, don't you think?) Heh heh cute.gif (*


Misha883 ( ) posted Wed, 01 January 2003 at 3:13 AM

It's 3:00am here, (happy New Year), I'll fire up photoshop tomorrow to check on "compression number." I used the lowest quality/highest compression possible in order to see the most difference. One pleasant surprise is really how well it does work; there is error, but not really that much considering how badly these images were abused. As for an article... I'm hoping someone tries out some of the "lossless" software, and writes a followup report.


hendrikm ( ) posted Wed, 01 January 2003 at 11:41 AM

Hi again, thanks for all your help. You guessed right, Im using a digital camera and cant shoot a tif or raw file, as it is to large and takes to much time to save. Ill try some of the mentioned software. @zhounder: Though in the JPEG Standard a lossless JPEG compression is defined, every jpeg compression with Photoshop (Version 6) is lossy... this is what I tried before. Im not sure about version 7, but the original handbook always talks about lossy compression in connection with JPEG. Thanks a lot!


hendrikm ( ) posted Wed, 01 January 2003 at 12:48 PM

file_38861.jpg

Ok, back again. I did some tests myself. I took one of the original images and rotated it four times in photoshop 7 and saved it with a quality setting of 12 each time. As you can see, its not the same image as before. I followed Michaslink and found a list of software which should be able to do lossless rotation. On this list was also NikonView, the software I use to transfer the images from camera to my computer. I did the same here, and though the image size changes (+-20 kbyte on a 700 kbyte image), the picture didnt change. as there was nothing interesting to see, I made no screenshot. So for anyone interested, the link posted above should point out some software which can do lossless JPEG rotation. Thanks again for all your help!


Misha883 ( ) posted Wed, 01 January 2003 at 1:01 PM

Wonderful! [Dissapointing about Photoshop! Think anyone would pay for a phugin if I wrote one???] Good to know that some of the camera manufacturers' software is doing the rotation correctly. [I suspect Michelle's Dimage software is also working correctly.] Star- Don't know if we need a more detailed article than this?


starshuffler ( ) posted Wed, 01 January 2003 at 1:12 PM

Well, can anyone put this together? It seems awkward to cut and paste hehehe... I think this makes a good one for the archives. (Same goes for the cropping thread) (*


Misha883 ( ) posted Wed, 01 January 2003 at 3:21 PM

Attached Link: http://www.irfanview.com/

file_38862.jpg

I tried out one of the freewawe programs, and it works great! Interface is a little quirky, but workable. For all practical purposes zero error for rotation (of an integer multiple of 16) image. For non-integer multiples, the program crops off the edges to make it integer! Still no Photoshop plugin...


cynlee ( ) posted Wed, 01 January 2003 at 11:25 PM

hey- this is great info!! thanks Misha! finally got the digi, now I need a bigger monitor- mousing back & forth to read all the long sentence lines :D


tasquah ( ) posted Thu, 02 January 2003 at 7:39 AM

lol cynlee I thought it was only me. I dont mean to be a stickler , but on hendrikm example i dont see the difference like i did for Misha883 . Can we get a better sample so its clearer if this is going to be a tutorial kind of thread . Also what kind of setting was used to take the photo Low, Med,High . Is the loss only on the low dpi scale shots cammera settings or all of them ? . I mean if i am going to go get yet another program / software and its really not nessisary unless i am shooting lower rez or if i convert my jpg's to tiffs or BMPs do I have the same loss or only on JPG. I dont want to step on toes this thread is great and i see i have missed something i should have noticed before.


Misha883 ( ) posted Thu, 02 January 2003 at 9:07 AM

tas-- The stuff here from Photoshop (v7) all uses JPEG "3" (LOW). I'm sure any artifacts would be less with less compression. That is really one of the interesting conclusions about this exercise; one can really torture the images guite a lot before running into visible problems. [BTW, as far as I know, the value "3" is completely arbitrary, and is certainly different from program to program. In making comparisons it is better to use compression ratio. In my examples, 260K images were compressed down to about 40K.] Your point above was really the relevant one, with Photoshop: "Rotate before Cropping" for best results. Many of the programs at the link are FREE, (and some even claim lossless cropping). Can't hurt to have in the bag of tricks. Star-- I think I may take a vacation from doing tutorials. I will package up the individual photos (into tables), and mail them to you. I don't know enough about the various flavors of digital camera software in order to describe the best workflow getting pics out of the camera. Maybe tas or hendrik could help with this?


tasquah ( ) posted Thu, 02 January 2003 at 2:18 PM

I checked the links and found some more interesting data.
They recomend converting to a loss-free format like TIFF or BMP for saving, and only on completion of the work should JPEG be brought into play.

As much as I could make out ( most was in German ) the flip or rotate is moslty done to print or make "Digital photo albums "
Seems that you can do a rotate with no loss but theres a probibility in the save that you will get degredation or loss at that time.

Not bad for a quick and dirty rotate.

I can help with the info on getting the camera photos out . But i still recomend converting to BMP or Tiff and not working in JPG format if you really want a good end product photo.
By the way they are also talking about yet another new JPG version soon to be released that uses a whole new format its called "JPEG2000-method"


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.