Rotate images, very lossy

  • Thread starter Thread starter DanR
  • Start date Start date
D

DanR

When right clicking on an image file, say jpg, and choosing to rotate that
image... a file that may have been 2MB becomes 1MB. Seems to me that the
image is greatly degraded in quality. So I chose to not use this function.
However it's easy to click on that choice by mistake. I see that I can
highlight all the images in a folder and make them read-only and the rotate
option becomes grayed out. That's a good thing.
But I'm wondering if there is a setting that will up the compression quality
for image rotation. It could come in handy at times when building a slide
show.
 
Dan

JPG images are what's called a "lossy" image format. Everything you do to a
jpg image file will degrade the quality of the image. Making the files read
only will protect them. The only thing that makes this image format popular
is the extremely small size.

What you can do if you do want to rotate or perform other enhancing of a jpg
file is to first convert it to a "lossless" format such as, TIF, or PNG.
After you make the changes, you can save it back to the jpg format to keep
the size small.

A good, free imaging program, that can easily convert these files is one
called IrfanView.

IrfanView website:
http://www.irfanview.net/
 
what you say is terribly wrong.. once you save in jpg again you have lost
data...

I seldom see an MVP say something correct lately.. is this some retardation
due to vista use?

See this page MVP and learn http://www.snapfiles.com/get/rota.html

"Rotating a JPEG image usually takes 3 steps: de-compress JPEG to bitmap,
rotate bitmap, re-compress bitmap to JPEG. This re-compression process
causes additional loss of image quality. "


there are many programs like the above that can do lossless rotations and
even irfanview can if you know what you are doing..
MVPs that use vista apparently don't know.. or else they would not be using
vista the most horrible OS of all times!

the new irfanview supports lossless jpeg rotations if you install the plugin
pack as well, and is free of course
after you download and install it and the plugins then go to the menu>
Options> Lossless jpeg operations
see screenshot http://img300.imageshack.us/img300/905/clipboard01lj3.jpg
 
Rotating a compressed image (jpg) will always result in a degraded image.
This is because in order to rotate it the picture must be decompressed, then
rotated and then a degraded image (the origional jpg compression) is
degraded again in the recompression. Not much that you can do about that,
although I am supprised that 2MB went all the way to 1MB.

Michael
 
I have Photoshop on my XP partition and can easily rotate images with it.
Photoshop gives you a save-as quality choice. So I can rotate and minimize
any generation lose. Somewhere in the Vista code is a setting that
determines the jpg quality. Maybe not a setting per se but there must be
code that determines the algorithm. Even cameras usually give you at least
two choices. My newest camera knows when it shoots vertical and writes data
to the exif portion of the photo and most image software including Windows
will rotate the image properly. My older camera did not do this and I have
many hundreds of vertical images that need to be rotated for proper viewing.
It would be nice to be able to copy and rotate them in a batch. I've read
about software that will do just that but if Windows could rotate without
such a quality loss that would be nice. I bet there's a way.
 
I have Photoshop on my XP partition and can easily rotate images with it.
Photoshop gives you a save-as quality choice. So I can rotate and minimize
any generation lose. Somewhere in the Vista code is a setting that
determines the jpg quality. Maybe not a setting per se but there must be
code that determines the algorithm. Even cameras usually give you at least
two choices. My newest camera knows when it shoots vertical and writes data
to the exif portion of the photo and most image software including Windows
will rotate the image properly. My older camera did not do this and I have
many hundreds of vertical images that need to be rotated for proper viewing.
It would be nice to be able to copy and rotate them in a batch. I've read
about software that will do just that but if Windows could rotate without
such a quality loss that would be nice. I bet there's a way.

Photoshop which I've used since version 2 is a very high quality
application, with a price tag to match ;-). It includes Image Ready
which can greatly reduce file size without a serious hit in quality.
This feature is mainly for reducing images that end up on the web so
they don't take forever to download however you can use it for other
purposes.

It is the algorithms that determine what results you end up with.

Besides working on compressed images in a lossless state if you are
planning on reducing their dimensional size making them either smaller
or large an old Photoshop trick is to do it in stages. In other words
if you want to increase the dimensions of a image by 50% instead of
trying to do it in one big step, instead do it in stages of no more
than 10% a time.
 
what you say is terribly wrong.. once you save in jpg again you have lost
data...

I seldom see an MVP say something correct lately.. is this some retardation
due to vista use?

See this page MVP and learn http://www.snapfiles.com/get/rota.html

"Rotating a JPEG image usually takes 3 steps: de-compress JPEG to bitmap,
rotate bitmap, re-compress bitmap to JPEG. This re-compression process
causes additional loss of image quality. "

Don't confuse marketing hype with reality. Doubtless everyone has seen
all the threads saying Media Player, Movie Maker can't open such and
such video file. The reason is they are missing or can't use the de
compressor that's part of the CODEC. Same holds true with still
images. If they're compressed, then they need to be decompressed in
order to open them. What the ad copy on the above link implies is they
stop half way, which is just snake oil.

You can't un ring a bell, once any image video or still is compressed
some bits have been squeezed out, you can't put them back. In a
similar vain if you manipulate a raster based image then some pixels
are getting redistributed, discarded or added depending on what you're
trying to accomplish. It's the process itself and how well the
application can do the task that matters. The two most common methods
are Bilinear and Bicubic Interpolation. Better software uses smarter
algorithms.

Recompressing some already compressed image is a no-no. However
freezing it in it's current state by first transcoding it to a
lossless file format minimizes the re compression assuming the user
plans on re saving it in a compressed format again once he's done
working on it. Again HOW you do that, meaning what application you use
to accomplish it determines the final result.
 
so you too have been using vista so long your brain has been converted to
mush?

You can rotate jpeg without loss! google the keywords "lossless jpeg
rotation"
 
Ok, this is not so much a Vista thing as an image thing. No matter, I will
still comment.

I have read the thread, and agree wholeheartedly with the person who said to
convert it to an uncompressed format first, then work on it, and finally
save as the jpg. When I do a shoot, I will generate hundreds of images (both
raw + jpg). Once sorted, those that are of quality are converted to .tif
format (my personal preference) before any action occurs to the image,
whether rotating or editing. I _never_ work on a jpg and then save the
result, for reasons of loss.

Irfinview? Wonderful wonderful program for viewing, converting and cropping.
Highly recommended. For everything else I use GIMP.

R.
 
Opening the jpg and saving as a tif or "converting" from jpg to tif with a
program like Irfinview... Is there a difference? Is Irfinview able to make
that jpg into a tif that is of a higher quality than if you opened the jpg
and did a save-as to tif? Is there a separate conversion process different
from open / save-as?
I can clearly see that making the original jpg a lossless format is the way
to go if you intend to edit the image multiple times. But what if you know
you only need to edit the image once?
I have always thought that when you opened an image in photoshop... once
opened it didn't matter what the original format was. As an opened image
(file) it's uncompressed at that stage and you can note its uncompressed
file size. Always much larger than the original .jpg.
 
Opening the jpg and saving as a tif or "converting" from jpg to tif with a
program like Irfinview... Is there a difference?

While the method is often similar HOW any particular application does
its "thing" is determined by how well it's various Algorithms are
written.

Photoshop has been and remains the undisputed king of all photo
enhancement tools and it has been that for decades. I know of no
professional that uses something else. If Photoshop is 'that good' or
not I can't say, since I've always used Photoshop.

Some knock-off applications that try to mimic some of what Photoshop
can do like Paint Shop Pro, now bought out by Corel are also good and
for all the Linux haters out there, absolutely one of the best full
featured FREE graphic programs that's been ported to Windows from the
Linux world is GIMP which can give Photoshop a run for it's money.
Is Irfinview able to make
that jpg into a tif that is of a higher quality than if you opened the jpg
and did a save-as to tif? Is there a separate conversion process different
from open / save-as?

I've tried IrfranView and can't say that I was impressed. Remember
IrfranView is marketed as a VIEWER that can do conversions and make
some minor adjustments. It isn't a full blown graphics program. Saying
it is "good" is like somebody saying the few crude tools included in
Microsoft Photo Galley under "fix" are good tools or that Movie Maker
is the ultimate video editor. They are not. Both are basically toys
again NO professional would use either.

As far as quality, you can't unring a bell! If you start with a image
that is compressed, like a JPEG, a lot of the image's original bits
have been discarded in the initial compression process when the file
was originally saved. They're gone. Those bits no longer exist, these
is no way on God's green earth anything can put them back.

What you can do for lack of a better word is "freeze in time" the
current state of the image's overall quality by working on it in one
of several popular lossless formats. This can't make the image
"better" but it at least prevents it from detorating worse.

Lot of confusion on just exactly what this means. When you "open" a
graphic file regardless what application you use, it first has to
decompress the file if it's un a compressed format like a JPG.

If you're only going to do some quick and dirty fix and not save it to
come back to work on later, then you can safely skip the save in a
lossless format step. The reason you see a lot of people saying save
in a lossless format is the assumption is whatever you're going to do
will span time and they simply want you to avoid the constant
recompressing if your open the file, do a little work, then save it as
a JPG, a couple days later open it again, work on it some more save it
as another JPG and so. Don't do that. That's bad. Saving a file in the
application's native "save as" format should be ok, since your really
saving a project file which should just be instructions on what you
changed, but as of yet haven't rendered. Again check your application
manual to be sure that's what is really happening.
 
Carl

Thank you for posting the updated information.

I come to these newsgroups to gain knowledge, as well as help other users.
Fortunately, unlike yourself, I have never felt the need to add personal
insults or take cheap shots when I post information to help other users.
 
despite the bullshit posted already, please:

1.- there is absolutely NO WAY you can modify a jpg (open, change, save)
without a loss of quality, you can try to minimize the impact e.g. setting a
quality better than the original, but it is impossible to do a lossless
operation due to how the jpg format works... SO, "ROTATING" WILL be lossy,
everywhere and everytime

2.- the "ORIENTATION" of a photo taken with a camera is an EXIF field set by
the camera, and used by some picture viewers (not all) to modify its drawing
in the screen, e.g. you take a vertical photo, that photo is saved often as
horizontal with exif orientation set to 90 degrees, then the programs who
support the orientation will show you the photo in vertical, not horizontal,
and so on with 180 & 270 degrees... now you need to understand, windows'
quickview - image and fax viewer - photogallery do not support that field
thus they will show you the photo in an horizontal fashion always (though
you can set the import options to autorotate the photos that have
orientation information), changing the orientation field is what some
programs and people call "lossless rotation", but it is not, it will
actually NOT modify the jpg thus is not a "real" rotation and it is bound to
be viewable correctly in a program that supports that field, of course if
the programs you use do support it, it is a great way to "rotate"

now that was for everyone reading that may be confused (and sure there were
already)
about the original poster problem, i dont really know where to change it,
sorry, but i dont view that much loss either, i did some rotating in
top-high quality pictures with no visible loss (at least with only 1
rotation), maybe it depends on the original quality setting...
you can try comparing the actual result (say rotate 90 and then -90) with
the original and check for yourself side-to-side if the loss is acceptable
to your needs... cause talking only about size, maybe it is cutting size
from another part of the file (headers and such)

HTH
 
I just returned from a birthday party having taken 40 or so pictures with my
Canon XTi. I had 6 vertical pictures. Vista showed them horizontal in the
folder view. For some reason I thought Vista was smart enough to rotate them
vertical for viewing. But after copying the vertical pictures and rotating
them... I now find that they are exactly the same file size. I know for sure
that with other pictures the file size was halved after rotating. I vaguely
remember reading that lossless rotation can take place under certain
circumstances when the aspect or certain horizontal / vertical relationships
are present. Looks like I need to do more research / experiments.
 
While the method is often similar HOW any particular application does
its "thing" is determined by how well it's various Algorithms are
written.

True. The main point is, as Adam later says, "you can't un-ring a
bell", so neither can ever be as good as preserving the original
content, either "raw", or at least as a lossless generic image.


Raw image data is usually particular to whatever device it came from,
and has to be "cooked" to even see it.

For example, what comes off the scanner's pickup, or the camera's
sensor, is "raw", and the circuitry within the device bumps this down
to a generic image that can be directly viewed.

You can try to minimize the "editorialization" by not using in-device
manipulations, such as reduced resolution, sharpening, color
correction for light source, etc. but you still get a "cooked" result;
what was a scanner's 48-bit data stream is bumped down to 24-bit
TrueColor, and some processing has to be applied to a camera's raw
data to make any sense of it at all.

However, what modern cameras now do, is allow you to pull in raw data
and apply "camera logic" on the PC, which leaves the software applying
the logic in a controllable and vendor-improvable form.

Digital decisions you'd have made at the time of shooting, such as
color balancing for tungsten vs. phlorescent lighting, can now be
revisited when you process the raw data that predates whatever the
camera would have done to it. Optical decisions, such as optical zoom
or macro focusing, can't be revisited of course.


Lossless general image formats incluse those that are uncompressed,
such as .BMP, and those that may be losslessly compressed, such as
..TIF (lossless being the equivalent of zipping a .BMP).

You want to stay in these formats for the editing life of your image,
whether it be in Photoshop, GIMP or whatever. Perform the lossy
compression to .JPG (or the color reduction to .GIF) only at the final
output-for-purpose stage.

The way that JPEG works is inherently hostile to sharp, clear edges;
these get hammered into tramlines and blurring. For artwork that's
made up of sharp-edged stuff in few flat colors, as well as text and
screenshots, GIF may be better, even at the cost of shallower color.
Photoshop has been and remains the undisputed king of all photo
enhancement tools and it has been that for decades.

Yep. It's also damn expensive.
I've tried IrfranView and can't say that I was impressed. Remember
IrfranView is marketed as a VIEWER that can do conversions and make
some minor adjustments. It isn't a full blown graphics program.

Accepted. For example, when I was scanning photos and other damaged
paper artwork, I'd need semi-intelligent touch-up tools at the pixel
level, such as clone brush, selective sharpening etc. and I used Paint
Shop Pro for that, and still do. A particularly useful trick for
scanned artwork is to color-replace to the same color, which basically
reduces spurious color variation from the scanning process.

However, I find I rarely need pixel-level tools when working with
digital photos. I need what IView provides; a fast way to flip
through multiple shots, cropping, gamma adjustment and perhaps some
color balance over the whole pic, resampling, rotation and the ability
to save in different formats.
Saying it is "good" is ...

....more like saying the best racing bicycle is a good car. They are
inherently different tool sets - would you like to flip through images
in Photoshop, or have Photoshop drag itself off disk every time you
just wanted to look at a picture?
As far as quality, you can't unring a bell! If you start with a image
that is compressed, like a JPEG, a lot of the image's original bits
have been discarded in the initial compression process when the file
was originally saved. They're gone. Those bits no longer exist, these
is no way on God's green earth anything can put them back.

Yep - "information is that which cannot be re-created when lost".

It's interesting to crank up JPG compression to get a taste of what
"JPEGism" looks like - what I see is an image made up of tiles that
appear to be gradient-shaded according to corner pixel color values.

When that bangs into the tiling effect that is inherent in the matrix
mechanism of many sharpening, blurring etc. filtering tools, you can
predict you could be in for "beat noise" effects.


There's another possible reason for the subject line; problems that
arise when images are displayed in other than their natural
resolution, e.g. "full screen" or "to fit window". Image previewers
will nearly always work this way, as will IView if instructed to,
because screen res is lower than other output devices such as
printers, and decent cameras spawn images larger than the screen.

So an image that was well-resized (e.g. /2, /2, /2) to fit nicely when
(pre-)viewed as a "portrait", may mis-scale when rotated and viewed as
a "landscape". In addition, rotations of anything other than 90, 180
or 270 degrees are going to degrade the quality, because they require
a lot of edge-case pixel guessing.


--------------- ----- ---- --- -- - - -
To one who only has a hammer,
everything looks like a nail
 
DanR said:
Opening the jpg and saving as a tif or "converting" from jpg to tif with a
program like Irfinview... Is there a difference? Is Irfinview able to make
that jpg into a tif that is of a higher quality than if you opened the jpg
and did a save-as to tif? Is there a separate conversion process different
from open / save-as?

This thread should move into a newsgroup more appropriate to image
manipulation and similar. I'll make some brief comments in reply to the
above, then leave it alone hereafter.

Whatever loss you begin with is the loss that will be retained in the tif or
any other lossless format you convert to - once lost, gone forever. The
purpose of the conversion is to prevent any further loss during further
operations and saves of the jpg (not counting the loss with the final save
back to the jpg format).

Even better coming from my camera as a raw image - carry out any needed
adjustments directly to the raw image, save as a tif, perform any further
editing needed - no loss at any stage. When ready for distribution,
printing, using as a desktop image etc etc, then only one set of loss, that
of the final conversion into the jpg format. If needed, with the appropriate
plugins, Irfinview will also convert my raw images (.cr2) into tif (or any
other format I choose that is supported by Irfinview).

R.
 
More about how Windows displays photos in folders:
I have an older Olympus C3000Z and newer Canon XTi. Examining the exif data
I see that the Olympus writes the X and Y dimensions according to how the
camera was orientated while the picture was taken. If the picture was a
vertical picture the X is smaller than the Y dimension. My newer Canon does
not use this method but instead uses an orientation flag that is either
"normal" or "left bottom". With the Canon a vertical picture shows the X
dimension as larger than the Y dimension. Windows XP and Vista ignores the
orientation flag and displays my Canon vertical pictures horizontally. It
does display my Olympus vertical pictures correctly apparently using the Y
is larger than X in the exif data. Photoshop recognizes either camera
picture correctly and orientates the vertical picture correctly.
So my question is (OT for this group?) is the orientation flag in exif data
something new? (too new for Windows)

And about the lossy rotation subject. This topic has become OT for Windows
but here is what I've discovered. If I rotate images (right click rotate)
from various cameras that are native in aspect size to the camera... the
rotation is reasonably lossless. ie: the image file size remains almost the
same. Using 480 as a common denominator my Canon shoots at 720x480. My
Olympus shoots at 640x480 and film pictures returned on a CD are 724x480.
These pictures rotate with little change in file size. The pictures that
caused me to write the original thread question were wedding images from a
pro photographer. (Canon EOS 20D) All these images have a 600x480 (or
480x600) aspect ratio but all have differing dimensions. Example 1 is
1728x2160 example 2 is 2258x2823 etc. All different but still a 600x480
relationship. These are the pictures that when rotated lose half their image
file size and prompted the subject of this tread. I'd like to understand why
this happens but that is a question I suppose for a different NG.
 
"DanR" <[email protected]> wrote in message
This thread should move into a newsgroup more appropriate to image
manipulation and similar.

True. I'd never have read it, though.
Whatever loss you begin with is the loss that will be retained in the tif or
any other lossless format you convert to - once lost, gone forever.

True, and worse than that, some editing processes can generate
artefacts from interaction with spurious patterns added by lossless
compression, especially sharpening and other filters.


--------------- ----- ---- --- -- - - -
To one who has never seen a hammer,
nothing looks like a nail
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top