Welcome to DigiForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

irfanview lossless jpg rotation

 
Goto page 1, 2
   Digital Camera Community (Home) -> General Discussions RSS
Next:  filter size question  
Author Message
dohduhdah

External


Since: Sep 24, 2006
Posts: 1



(Msg. 1) Posted: Sun Sep 24, 2006 2:21 pm
Post subject: irfanview lossless jpg rotation
Archived from groups: alt>comp>freeware, others (more info?)

Hi.

When I try to use irfanview to rotate jpg pics with lossless jpg
operations, I notice that the filesize
changes. When I do lossless rotations in ACDSee, I notice the filesize
stays identical.
Is there any way to rotate pics with irfanview that will yield an
identical filesize for the rotated jpg?

Greetings and thanks in advance for any feedback, Niek

 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Paul Lutus

External


Since: Sep 24, 2006
Posts: 2



(Msg. 2) Posted: Sun Sep 24, 2006 4:11 pm
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

dohduhdah.DeleteThis@yahoo.com wrote:

>
> Hi.
>
> When I try to use irfanview to rotate jpg pics with lossless jpg
> operations, I notice that the filesize
> changes. When I do lossless rotations in ACDSee, I notice the filesize
> stays identical.
> Is there any way to rotate pics with irfanview that will yield an
> identical filesize for the rotated jpg?

By definition, rotated JPG files should not be the same size, except by pure
chance. Because JPG is a lossy compression method, this should not be
expected.

If a program emits a rotated JPG that is always the same size as the
original, there is something wrong with the algorithm. The result should be
larger or smaller, randomly, and only very rarely the exact same size.

--
Paul Lutus
http://www.arachnoid.com

 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Don Wiss

External


Since: Sep 04, 2005
Posts: 151



(Msg. 3) Posted: Sun Sep 24, 2006 9:21 pm
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 24 Sep 2006 16:11:28 -0700, Paul Lutus <nospam.RemoveThis@nosite.zzz> wrote:

>dohduhdah@yahoo.com wrote:
>> When I try to use irfanview to rotate jpg pics with lossless jpg
>> operations, I notice that the filesize
>> changes. When I do lossless rotations in ACDSee, I notice the filesize
>> stays identical.
>> Is there any way to rotate pics with irfanview that will yield an
>> identical filesize for the rotated jpg?
>
>By definition, rotated JPG files should not be the same size, except by pure
>chance. Because JPG is a lossy compression method, this should not be
>expected.

Wrong. The thread is about lossless jpg rotation. The file is not
decompressed and recompressed. It is rotated without changing the
compression.

I just rotated a file 90 degrees losslessly in IrfanView. It went from
636,930 bytes to 630,305 bytes. I rotated it back, going in 90 degree
increments three times. Now it is 631,432, though it is the same
orientation as it started.

I just tried jpegcrop. It also rotates losslessly. I started with the
orginal file again. To summarize:

Original: 636,930 bytes
180 flip: 636,982
90 left: 635,768
90 right: 635,726

Don <www.donwiss.com> (e-mail link at home page bottom).
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
www.kevinkienlein.com

External


Since: Sep 19, 2006
Posts: 69



(Msg. 4) Posted: Mon Sep 25, 2006 12:12 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Is this a good program to use... i am just new to dig photography and i am
jsut getting started on learning PhotoshopCS...

tnx kk


--
=>Kevin Kienlein - Entertainer/Inspirational Speaker
=>Vernon, BC, Canada
=>See my NEW WEBSITE http://www.kevinkienlein.com
=>Never give in, NEVER, NEVER, NEVER!
=>Life is the Gig, THIS AIN'T NO REHEARSAL!
=>Age 45/Tricuspid, Atresia, Atrial & Vent, Septal Defects.
=>My Congenital Heart Defects
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
sid derra

External


Since: Apr 26, 2006
Posts: 26



(Msg. 5) Posted: Mon Sep 25, 2006 1:55 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Don Wiss" <donwiss DeleteThis @no_spam.com> wrote in message
news:vuaeh2tkvs42fs0ebl72cf9umhm3es6of6@4ax.com...
> On Sun, 24 Sep 2006 16:11:28 -0700, Paul Lutus <nospam DeleteThis @nosite.zzz> wrote:
>
>>dohduhdah@yahoo.com wrote:
>>> When I try to use irfanview to rotate jpg pics with lossless jpg
>>> operations, I notice that the filesize
>>> changes. When I do lossless rotations in ACDSee, I notice the filesize
>>> stays identical.
>>> Is there any way to rotate pics with irfanview that will yield an
>>> identical filesize for the rotated jpg?
>>
>>By definition, rotated JPG files should not be the same size, except by
>>pure
>>chance. Because JPG is a lossy compression method, this should not be
>>expected.
>
> Wrong. The thread is about lossless jpg rotation. The file is not
> decompressed and recompressed. It is rotated without changing the
> compression.
>
> I just rotated a file 90 degrees losslessly in IrfanView. It went from
> 636,930 bytes to 630,305 bytes. I rotated it back, going in 90 degree
> increments three times. Now it is 631,432, though it is the same
> orientation as it started.
>
> I just tried jpegcrop. It also rotates losslessly. I started with the
> orginal file again. To summarize:
>
> Original: 636,930 bytes
> 180 flip: 636,982
> 90 left: 635,768
> 90 right: 635,726

irfan might be able to shed some light on this...
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Martin Brown

External


Since: Aug 11, 2006
Posts: 37



(Msg. 6) Posted: Mon Sep 25, 2006 2:47 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Don Wiss wrote:
> On Sun, 24 Sep 2006 16:11:28 -0700, Paul Lutus <nospam.TakeThisOut@nosite.zzz> wrote:
>
> >dohduhdah@yahoo.com wrote:
> >> When I try to use irfanview to rotate jpg pics with lossless jpg
> >> operations, I notice that the filesize
> >> changes. When I do lossless rotations in ACDSee, I notice the filesize
> >> stays identical.

Tends to suggest ACDSee does it with a flag then. Lossless rotation of
a JPEG should normally change the filesize very slightly. +- 0.1% or so
would be typical.

> >> Is there any way to rotate pics with irfanview that will yield an
> >> identical filesize for the rotated jpg?
> >
> >By definition, rotated JPG files should not be the same size, except by pure
> >chance. Because JPG is a lossy compression method, this should not be
> >expected.
>
> Wrong. The thread is about lossless jpg rotation. The file is not
> decompressed and recompressed. It is rotated without changing the
> compression.

It is losslessly decompressed into the JPEG coefficient space,
transposed to change the real space orientation of the image and then
losslessly recompressed. At no point in this process do the lossy steps
of cosine tranform or quantisation occur. It is truly lossless.

The reordering of the coefficients means that it is most unlikely that
a losslessly rotated image will have exactly the same size as the
original.

However due to quirks in some decoders handling of 2x1 vs 1x2 chroma
subsampling it is possible that lossless rotate JPEG image +90 subtract
rotate BMP image +90 is not identically zero. This does not mean that
the JPEG rotation failed. If you losslessly rotate the JPEG back to its
original state the decoding will be identical.
>
> I just rotated a file 90 degrees losslessly in IrfanView. It went from
> 636,930 bytes to 630,305 bytes. I rotated it back, going in 90 degree
> increments three times. Now it is 631,432, though it is the same
> orientation as it started.
>
> I just tried jpegcrop. It also rotates losslessly. I started with the
> orginal file again. To summarize:
>
> Original: 636,930 bytes
> 180 flip: 636,982
> 90 left: 635,768
> 90 right: 635,726

Reordering the sequence of coefficients in a block changes their
compressibilty slightly. However the size difference in all but the
most pathological of test cases is miniscule.

Regards,
Martin Brown
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Ron Hunter

External


Since: Nov 24, 2005
Posts: 2796



(Msg. 7) Posted: Mon Sep 25, 2006 2:55 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

www.kevinkienlein.com wrote:
> Is this a good program to use... i am just new to dig photography and i am
> jsut getting started on learning PhotoshopCS...
>
> tnx kk
>
>
It is a great program for quick and easy display and minor editing of
pictures. A free program that does everything this one does is a thing
of beauty, and well worth the download. Compared with Photoshop CS, the
editing ability is trivial, but you can load Irfanview, display a dozen
pictures, edit and save one while Photoshop CS is still loading, at
least on most computers.
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
John Bean

External


Since: Oct 02, 2005
Posts: 466



(Msg. 8) Posted: Mon Sep 25, 2006 6:55 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 24 Sep 2006 14:21:19 -0700, dohduhdah.TakeThisOut@yahoo.com wrote:
>When I try to use irfanview to rotate jpg pics with lossless jpg
>operations, I notice that the filesize
>changes. When I do lossless rotations in ACDSee, I notice the filesize
>stays identical.

Was the EXIF (and other metadata) intact after the rotation?


--
John Bean
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Paul Lutus

External


Since: Sep 24, 2006
Posts: 2



(Msg. 9) Posted: Mon Sep 25, 2006 8:47 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Don Wiss wrote:

> On Sun, 24 Sep 2006 16:11:28 -0700, Paul Lutus <nospam.DeleteThis@nosite.zzz> wrote:
>
>>dohduhdah@yahoo.com wrote:
>>> When I try to use irfanview to rotate jpg pics with lossless jpg
>>> operations, I notice that the filesize
>>> changes. When I do lossless rotations in ACDSee, I notice the filesize
>>> stays identical.
>>> Is there any way to rotate pics with irfanview that will yield an
>>> identical filesize for the rotated jpg?
>>
>>By definition, rotated JPG files should not be the same size, except by
>>pure chance. Because JPG is a lossy compression method, this should not be
>>expected.
>
> Wrong. The thread is about lossless jpg rotation.

The thread is based on a misconception. There is no such thing as lossless
JPEG rotation.

> The file is not
> decompressed and recompressed. It is rotated without changing the
> compression.

That isn't possible. JPEG doesn't work this way. In order for a JPEG file to
be rotated, it must first be decompressed into an RGB form, rotated, then
recompressed.

>
> I just rotated a file 90 degrees losslessly in IrfanView.

No, you did not.

> It went from
> 636,930 bytes to 630,305 bytes. I rotated it back, going in 90 degree
> increments three times. Now it is 631,432, though it is the same
> orientation as it started.

I originally said there was a random relationship between starting and
ending file sizes. So, Q.E.D.

>
> I just tried jpegcrop. It also rotates losslessly.

JPEG is a lossy compresion method. Please stop referring to it as
"lossless". Each decompression/recompression cycle can and normally does
degrade the original image content.

> I started with the
> orginal file again. To summarize:
>
> Original: 636,930 bytes
> 180 flip: 636,982
> 90 left: 635,768
> 90 right: 635,726

As expected. These numbers tell us nothing about the state of the image
itself, all they do is show that the numbers vary randomly.

--
Paul Lutus
http://www.arachnoid.com
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Keith Sheppard

External


Since: Nov 08, 2005
Posts: 119



(Msg. 10) Posted: Mon Sep 25, 2006 8:55 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

>>When I try to use irfanview to rotate jpg pics with lossless jpg
>>operations, I notice that the filesize
>>changes. When I do lossless rotations in ACDSee, I notice the filesize
>>stays identical.
>>Is there any way to rotate pics with irfanview that will yield an
>>identical filesize for the rotated jpg?

Why worry that the file size has changed? If you just want an explanation,
how about this one...

A jpeg file contains a lot more than just the jpeg image data. There is a
whole load of header stuff (eg. EXIF headers) and the spec is such that it
gives application software a huge amount of leeway in how it lays it out.
There are even opportunities for software to add history information (eg.
the fact that it _was_ rotated).

Just to take a specific example, I discovered that the firmware in my first
camera layed out the header information in a very inefficient manner. It
looks like the main reason was to ensure that specific items always ended up
at fixed offsets within the file. I guess the firmware writers used this
"bodge" to reduce the size, or increase the speed, of the firmware
algorithms in the camera. I discovered that simply opening the photo in my
own photo application and rewriting it _without_ resampling the image (ie. a
lossless rewrite) saved me hundreds of bytes on every image.

I would expect the actual compressed image data for a lossless rotation
would probably be identical in size to the original (I'm not sure if there
could be a small difference if the width and/or height was not a multiple of
8 pixels but the difference, if any, would be trivial). However the
lossless rotation program has two options. It could take the original file
and "patch" the new image data over the original - making no change to the
headers other than to change the image dimensions. Just as legitimately,
though, it could read in and process all the header information and write a
new jpeg, using its own personal preferences as to how to lay out the header
information, and produce a file of a different size.

The point is that it really doesn't matter. Provided your application does
what it says on the tin and does a true lossless rotation, and assuming that
the application isn't so dumb as to lose header fields, who cares if the
file size is a few bytes different from what you started with? Has the
quality of the picture deteriorated? Have any header fields been lost? Are
the files now so huge that they fill your disk when they didn't before?

Provided you can record a "no" against all of those, I would just stop
worrying about it but if you cannot do that, just send me a before and after
image and I'll run it through my application's image analyser and tell you
where the extra data went or came from.

Keith
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Bill Tuthill

External


Since: Sep 07, 2006
Posts: 291



(Msg. 11) Posted: Mon Sep 25, 2006 9:27 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In rec.photo.digital Paul Lutus <nospam RemoveThis @nosite.zzz> wrote:
>
> The thread is based on a misconception. There is no such thing as lossless
> JPEG rotation. That isn't possible. JPEG doesn't work this way.
> In order for a JPEG file to be rotated, it must first be decompressed
> into an RGB form, rotated, then recompressed.

You do not understand JPEG encoding. Lossless rotation is possible
in 90 degree increments because the DCT-encoded 8x8 blocks are turned
on their side, but their quantization tables remain the same.

What really destroys JPEG quality is when the 8x8 blocks are recoded,
especially at different Q-values or with altered chroma subsampling.
As the JPEG FAQ says, increasing lossiness is worse at high Q values
but (counterintuitively) not so bad at low Q values.

Somebody else wrote:
>> It went from 636,930 bytes to 630,305 bytes. I rotated it back,
>> going in 90 degree increments three times. Now it is 631,432,
>> though it is the same orientation as it started.

That can probably be explained by size-reduction of header information,
or possibly more efficient encoding. Also, quantization tables might
occupy more or less space depending on landscape/portrait orientation.

> JPEG is a lossy compresion method. Please stop referring to it as
> "lossless". Each decompression/recompression cycle can and normally does
> degrade the original image content.

The loss has already occurred, but rotation incurs no additional loss,
so perhaps it should be called loss-constant rotation.
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Bruce Uttley

External


Since: Apr 17, 2006
Posts: 4



(Msg. 12) Posted: Mon Sep 25, 2006 12:55 pm
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <1159132879.572493.251450.RemoveThis@i42g2000cwa.googlegroups.com>,
<dohduhdah.RemoveThis@yahoo.com> wrote:
>
>Hi.
>
>When I try to use irfanview to rotate jpg pics with lossless jpg
>operations, I notice that the filesize
>changes. When I do lossless rotations in ACDSee, I notice the filesize
>stays identical.
>Is there any way to rotate pics with irfanview that will yield an
>identical filesize for the rotated jpg?
>
>Greetings and thanks in advance for any feedback, Niek

One of the lossless transformation options in irfanview is
"None (can be used for optimizing and cleaning)". All lossless
rotations in irfanview 'optimize' and 'clean' the resulting file.
The resulting image is not degraded in any way.
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Don Wiss

External


Since: Sep 04, 2005
Posts: 151



(Msg. 13) Posted: Mon Sep 25, 2006 8:54 pm
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, 25 Sep 2006 10:59:50 +0100, John Bean <waterfoot DeleteThis @gmail.com> wrote:

>On 24 Sep 2006 14:21:19 -0700, dohduhdah DeleteThis @yahoo.com wrote:
>>When I try to use irfanview to rotate jpg pics with lossless jpg
>>operations, I notice that the filesize
>>changes. When I do lossless rotations in ACDSee, I notice the filesize
>>stays identical.
>
>Was the EXIF (and other metadata) intact after the rotation?

Yes. When losslessly rotating in either IrfanView or jpegcrop the EXIF
remains intact. Also when cropping losslessly in jpegcrop (only on 8 bit
increments) it also remains intact.

Both also preserve the orginal time stamp.

Don <www.donwiss.com> (e-mail link at home page bottom).
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Don Wiss

External


Since: Sep 04, 2005
Posts: 151



(Msg. 14) Posted: Mon Sep 25, 2006 9:01 pm
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, 25 Sep 2006, beu.DeleteThis@ist.uwaterloo.ca (Bruce Uttley) wrote:

>One of the lossless transformation options in irfanview is
>"None (can be used for optimizing and cleaning)". All lossless
>rotations in irfanview 'optimize' and 'clean' the resulting file.
>The resulting image is not degraded in any way.

Now I see. The check box for Optimize is checked. If I uncheck it the size
changes slightly, and the new sizes match what I posted for jpegcrop above.
So jpegcrop doesn't optimize. This is fine, as I use IrfanView to rotate.
And as you point out, I could use IrfanView to slightly reduce all of my
jpegs.

Don <www.donwiss.com> (e-mail link at home page bottom).
 >> Stay informed about: irfanview lossless jpg rotation 
Back to top
Login to vote
Ed Ruf

External


Since: Apr 12, 2006
Posts: 80



(Msg. 15) Posted: Tue Sep 26, 2006 7:57 am
Post subject: Re: irfanview lossless jpg rotation [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
Display posts from previous:   
Related Topics:
irfanview/exif fields/cd - irfanview 3.98 has the nice feature that it can display EXIF-fields. Unfortunately, this does not seem to work if irfanview is started from a CD. I haven't been able to figure why. Anyone out there has an idea? Oskar

Playing video with IrfanView - Does anyone here have a good grasp of how IV plays video files please? There are 4 settings: 2 options in the main IV window, under Options|Properties|Video/Sound. 1) Use external player (IV_Player PlugIn required!) 2) Use internal video/sound player An...

IrfanView cropping puzzle - I want an all black image of size 288x216 pixels. Rather than use Image > Create new (which means altering my standard non-black background colour), I opened an existing 1024x768 black image and did these operations: 1. Shift-c (to get customised..
   Digital Camera Community (Home) -> General Discussions All times are: Pacific Time (US & Canada) (change)
Goto page 1, 2
Page 1 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]