Tom's Hardware > Forum > Digital Camera > Digital Camera General > File sizes, can anybody explain

File sizes, can anybody explain

Forum Digital Camera : Digital Camera General - File sizes, can anybody explain

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: rec.photo.digital (More info?)

 

OK, so I open a JPEG which has come straight from my camera a Panasonic
DMC-LC1

MS Explorer reports that the original file size is 1920 x 2560 = 3.59 MB

I open the file in PhotoShop and adjust levels, saturation and then sharpen
it a bit. I then save it as a copy and select 'Quality 12 Maximum ' when
prompted.

How is it that the file size is now 6.06 MB and where has the extra
information come from ?

Also, if I save the file as a TIFF, the file size increases to 14 MB !

I am confused....

Steve
--

Sponsored Links
Register or log in to remove.

Archived from groups: rec.photo.digital (More info?)

 

Biker2 (Threadstopper) wrote:
> OK, so I open a JPEG which has come straight from my camera a Panasonic
> DMC-LC1
>
> MS Explorer reports that the original file size is 1920 x 2560 = 3.59 MB
>
> I open the file in PhotoShop and adjust levels, saturation and then sharpen
> it a bit. I then save it as a copy and select 'Quality 12 Maximum ' when
> prompted.
>
> How is it that the file size is now 6.06 MB and where has the extra
> information come from ?
>
> Also, if I save the file as a TIFF, the file size increases to 14 MB !

If you saved it as "FITS" it would be enormous.

Try googling for file formats and compression.

BugBear

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

"Biker2 (Threadstopper)" <steve at pvl dot co dot uk> wrote in message
news:431d7449$0$12880$cc9e4d1f@news.dial.pipex.com...
> OK, so I open a JPEG which has come straight from my camera a Panasonic
> DMC-LC1
>
> MS Explorer reports that the original file size is 1920 x 2560 = 3.59 MB
>
> I open the file in PhotoShop and adjust levels, saturation and then
> sharpen
> it a bit. I then save it as a copy and select 'Quality 12 Maximum ' when
> prompted.
>
> How is it that the file size is now 6.06 MB and where has the extra
> information come from ?
>
> Also, if I save the file as a TIFF, the file size increases to 14 MB !
JPG compression is what is known as a "lossy" compression method. This means
that it throws away some of the information in the photo when it saves it,
the idea being that the extra detail won't normally be noticed. For example
if JPG was a method of compressing words, JPG compression of "Good Morning"
might come out as "Gd Mrning" - we can still understand it, but there is
less actual detail there. We can never really know if "Gd" is "Good" or
"Gold" but our brain fills in the blanks and understands what is being said.
When your camera took the photo, it took an image with slightly more than
1920x2560 pixels - It processes the results from the sensor to come up with
an image that is 1920x2560 pixels x 3 colours (1 byte per colour), or
14,745,600 Bytes of information (14MB). It then converts that image
information into a JPG image, by throwing away some of the information in
the image. The bits it throws away are the bits that will have the least
impact on the final picture - so for example it might throw away some of the
sky. This squashing down will result in an image that contains a lot less
information but will still look pretty darned good to all but the pickiest
eyes. So 14MB has now become 3.59MB. When Photoshop opens an image, it
internally processes the image as a bitmap, so that 3.59MB JPG file gets
expanded out to create a 1920x2560 pixels x 3 colours image stored in
memory. This 14MB of information will be slightly different to the original
14MB that your camera captured, because photoshop has no way of knowing
exactly what was in the bits that were thrown away, but it makes a pretty
good guess. Now when you save this as a JPG with photoshop, it will again
throw away some of the information. The quality level you choose determines
how much it throws away. So at level 12, it hasn't thrown away as much as
your camera originally did, so the file size is now about 6MB.

If you save it as TIFF, no data is thrown away, it stores all of the bitmap
information that photoshop has been using internally, thus you get a 14MB
file, because there is 14MB of pixel data that it is using.

You will probably find that a quality level of about 8-10 in photoshop will
give a similar file size to the original, however this does not mean that it
is saving the exact same data that the camera saved. The picture information
it throws away could be the image data that photoshop created when it
expanded the image out to full size, or it could be throwing away some of
the real image data and keeping the made up data - there is no way of it or
you knowing. So if you were to repeatedly open and save the file, it will
progressively get worse, as less and less of the original image data will be
preserved. For this reason if you are going to be doing progressive editing
of a photo, you should save it as a TIFF file at intermediate steps. JPG is
ok when you have finished any editing you are likely to do and have come up
with a version you will either print or display. Many will recommend that
JPG not be used at all, but I think this is overkill. Just don't use JPG if
you are going to be repeatedly open->edit->save on a file.
The actual methodology of JPG storage does vary a little from what I
described, and it is much more complex, but the above should give you some
understanding of how it works.
>
> I am confused....
>
> Steve
> --
>
>

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

"Biker2 \(Threadstopper\)" <steve at pvl dot co dot uk> wrote:

> OK, so I open a JPEG which has come straight from my camera a Panasonic
> DMC-LC1
>
> MS Explorer reports that the original file size is 1920 x 2560 = 3.59 MB

No.. Pixels and bytes are completely different things. They start
with the prefix 'Mega' which means million.. That's the ONLY thing they
have in common.

If you multiply 1920 pixels x 2560 pixels you get 4.9 Megapixels
In other words, you have a 5 megapixel camera.

>
> I open the file in PhotoShop and adjust levels, saturation and then sharpen
> it a bit. I then save it as a copy and select 'Quality 12 Maximum ' when
> prompted.
>
> How is it that the file size is now 6.06 MB and where has the extra
> information come from ?
>
> Also, if I save the file as a TIFF, the file size increases to 14 MB !

The TIFF file represents the ACTUAL memory your image requires.

There are a minimum number primary colors required to make up the
range of color we see. JPEG uses RGB which consists of a RED, GREEN
and BLUE component. That's three colors.

The JPEG file system uses one byte to represent each color. So
if you have three colors, you need three bytes to create a pixel.

Your camera produces 4.9 Million pixels, so it requires

3 Bytes x 4.9 Million pixels = 14.7 Million bytes or 14.7 Megabytes

As others have mentioned, JPEG uses compression.. That's how the
file gets shrunk down to the 3 megabyte range.

JPEG saves disk space (or memory card space) by using a mathematical
formula to compress the file down to a smaller size. That's why your
camera produces JPEG images that are 3.5 Megabytes instead of 14
megabytes.

Imagine if there were no compression.. You'd have to buy a lot more
memory cards to hold the same amount of images.

Note that JPEG only saves disk or memory card space. when you view
the images they MUST be uncompressed back to their original 14 megabytes.

When you edit the image, it is also uncompressed back to 14 megabytes.
This is why you get a 14 megabyte image when you save as TIFF.. It gets
saved as is and doesn't get compressed.

JPEG has different levels of compression. You can do a little or a lot.

The 3.5 Meg image from the camera was uncompressed back to it's original
14 megabytes when you opened it in your editing program.

When you saved this 14 megabyte file again, you didn't compress it at the
same level as your camera did, so it was shrunk to 6 megabytes rather than
3.5 megabytes.

Reply to Anonymous
- 0 +

Archived from groups: rec.photo.digital (More info?)

 

"Biker2 (Threadstopper)" <steve at pvl dot co dot uk> wrote in message
news:431d7449$0$12880$cc9e4d1f@news.dial.pipex.com...
> OK, so I open a JPEG which has come straight from my camera a Panasonic
> DMC-LC1
>
> MS Explorer reports that the original file size is 1920 x 2560 = 3.59 MB
You math is a bit off. My calculator shows that 1920x2560 is 4.91
Megapixels (not MB).
>
> I open the file in PhotoShop and adjust levels, saturation and then
> sharpen
> it a bit. I then save it as a copy and select 'Quality 12 Maximum ' when
> prompted.
>
> How is it that the file size is now 6.06 MB and where has the extra
> information come from ?
Since there are three bytes per pixel when you are use 8 bits per channel,
the size is three times the number of megapixels. Using quality = 12 causes
the program to discard enough information to reduce the file size. There is
no "extra information" here.
>
> Also, if I save the file as a TIFF, the file size increases to 14 MB !
As it should. Three bytes per pixels means that the uncompressed image
requires almost 15 MB.
>
> I am confused....
You are not alone in that respect.
Jim
>
> Steve
> --
>
>

Reply to Jim

Archived from groups: rec.photo.digital (More info?)

 

"Jim" <j.n@nospam.com> wrote in message
news:VIhTe.1115$6e1.598@newssvr14.news.prodigy.com...
>
> "Biker2 (Threadstopper)" <steve at pvl dot co dot uk> wrote in message
> news:431d7449$0$12880$cc9e4d1f@news.dial.pipex.com...
> > OK, so I open a JPEG which has come straight from my camera a Panasonic
> > DMC-LC1
> >
> > MS Explorer reports that the original file size is 1920 x 2560 = 3.59 MB
> You math is a bit off. My calculator shows that 1920x2560 is 4.91
> Megapixels (not MB).

I am using XP and in the bottom right hand corner of explorer it definately
says 3.59 'MB'

Steve......

(not so confused now thanks to you and the other contributors)
--

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

Biker2 (Threadstopper) mentioned in passing :
>
>>>
>>> MS Explorer reports that the original file size is 1920 x 2560 =
>>> 3.59 MB
>
>> You math is a bit off. My calculator shows that 1920x2560 is 4.91
>> Megapixels (not MB).
>
> I am using XP and in the bottom right hand corner of explorer it
> definately says 3.59 'MB'

This seems to be a confusion of pixel count and file size. Multiplying
pixels across by pixels down gives you the number of pixels, the bottom
right hand corner gives you the "MB" (megabytes) of disc space used to store
the file. Two different things. Depending on color depth (for instance), the
file size is different for two equally sized images.

Here is a pretend representation of a 4 pixel image file with 8 bit color
10101010
11001100
11011011
10010010

There are 32 characters, takes up, lets pretend, 32 bytes.

Here is a (pretend) 16 bit image the same pixel size.
1010101010101010
1100110011001100
1101101101101101
1001001001001001

64 characters, 64 (pretend) bytes on the disk, but still only four pixels.

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

Bill DeWitt <Bill.DeWitt@adelphia.net> wrote:
>
> Here is a pretend representation of a 4 pixel image file with 8 bit color
> 10101010
> 11001100
> 11011011
> 10010010
>
> There are 32 characters, takes up, lets pretend, 32 bytes.
>

Uhm ... 8 bits is one byte and you just represented 4 bytes in the above
example.

> Here is a (pretend) 16 bit image the same pixel size.
> 1010101010101010
> 1100110011001100
> 1101101101101101
> 1001001001001001
>
> 64 characters, 64 (pretend) bytes on the disk, but still only four pixels.
>

This is eight bytes.

--
Thomas T. Veldhouse
Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1
Spammers please contact me at renegade@veldy.net.

Reply to Anonymous
- 0 +

Archived from groups: rec.photo.digital (More info?)

 

"Biker2 (Threadstopper)" <steve at pvl dot co dot uk> wrote in message
news:431dab36$0$12901$cc9e4d1f@news.dial.pipex.com...
>
> "Jim" <j.n@nospam.com> wrote in message
> news:VIhTe.1115$6e1.598@newssvr14.news.prodigy.com...
>>
>> "Biker2 (Threadstopper)" <steve at pvl dot co dot uk> wrote in message
>> news:431d7449$0$12880$cc9e4d1f@news.dial.pipex.com...
>> > OK, so I open a JPEG which has come straight from my camera a
>> > Panasonic
>> > DMC-LC1
>> >
>> > MS Explorer reports that the original file size is 1920 x 2560 = 3.59
>> > MB
>> You math is a bit off. My calculator shows that 1920x2560 is 4.91
>> Megapixels (not MB).
>
> I am using XP and in the bottom right hand corner of explorer it
> definately
> says 3.59 'MB'
That is the file size in megabytes. Explorer knows nothing about pixels,
hence you cannot determine the number of pixels by merely looking at the
file size (especially of a jpg).
For example, I have a shot of the moon which I took with my D70. In
Photoshop, the image size is shown as 2000 x 3009 pixels (that is 6
megapixels) and 17.1 MB. However, explorer reports the size of the jpg as
256KB. As the moon requires only a small part of the image, even low
compression to jpg results in a small file size. I was just trying to see
if I could get a reasonable shot at all else I would have saved it as a
Tiff.
Jim
>
> Steve......
>
> (not so confused now thanks to you and the other contributors)
> --
>
>

Reply to Jim

Archived from groups: rec.photo.digital (More info?)

 

Thomas T. Veldhouse mentioned in passing :
>
> Uhm ... 8 bits is one byte and you just represented 4 bytes in the
> above example.

For the sake of example, I used a clearly and redundantly marked
"pretend" representation with "pretend" bytes. If you want a technical
discussion, your local community college will have classes available for a
fee. They will be called "Reading for Comprehension 101" or "Introduction to
Not Taking Yourself So Seriously"...

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

Bill DeWitt <Bill.DeWitt@adelphia.net> wrote:
> Thomas T. Veldhouse mentioned in passing :
>>
>> Uhm ... 8 bits is one byte and you just represented 4 bytes in the
>> above example.
>
> For the sake of example, I used a clearly and redundantly marked
> "pretend" representation with "pretend" bytes. If you want a technical
> discussion, your local community college will have classes available for a
> fee. They will be called "Reading for Comprehension 101" or "Introduction to
> Not Taking Yourself So Seriously"...

What were you pretending? That 8 bits equals 8 bytes? Yes, that is
indeed what you were pretending. I was offering constructive criticism,
but you inability to take it suggests you don't want to admit the error.

What would be the purpose of pretending that bits are bytes?

--
Thomas T. Veldhouse
Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1
Spammers please contact me at renegade@veldy.net.

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

On 06 Sep 2005 15:41:42 GMT, Thomas T. Veldhouse wrote:

>> Bill DeWitt <Bill.DeWitt@adelphia.net> wrote:
>>
>> Here is a pretend representation of a 4 pixel image file with 8 bit color
>> 10101010
>> 11001100
>> 11011011
>> 10010010
>>
>> There are 32 characters, takes up, lets pretend, 32 bytes.
>>
>
> Uhm ... 8 bits is one byte and you just represented 4 bytes in the
> above example.

That's the problem with you and others who are mired in reality
based thinking. BD has no need to waste time with little "real"
bytes when larger "pretend" bytes can show so much more.


> G C Dm7 C C7
> Oh, yes, I'm the great pretender,
>
> F Fm C C7
> Pretending that I'm doing well;
>
> F G7 C Am F
> My need is such, I pretend too much --
>
> Dm7 C Dm7 G7 C
> I'm lonely, but no one can tell.

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

On Tue, 6 Sep 2005 13:44:53 -0400, "Bill DeWitt"
<Bill.DeWitt@adelphia.net> wrote:

>Thomas T. Veldhouse mentioned in passing :
>>
>> Uhm ... 8 bits is one byte and you just represented 4 bytes in the
>> above example.
>
> For the sake of example, I used a clearly and redundantly marked
>"pretend" representation with "pretend" bytes. If you want a technical
>discussion, your local community college will have classes available for a
>fee. They will be called "Reading for Comprehension 101" or "Introduction to
>Not Taking Yourself So Seriously"...
>
The example you gave did represent 4 bytes; "pretending" it is 32
bytes is very confusing.
If I were to use that kind of "pretending" in any class, I'd certainly
hear about it.

--
Bill Funk
Replace "g" with "a"
funktionality.blogspot.com

Reply to Anonymous
- 0 +

Archived from groups: rec.photo.digital (More info?)

 

On Tue, 6 Sep 2005 11:49:23 +0100, "Biker2 \(Threadstopper\)" <steve at pvl dot
co dot uk> wrote:

>OK, so I open a JPEG which has come straight from my camera a Panasonic
>DMC-LC1
>
>MS Explorer reports that the original file size is 1920 x 2560 = 3.59 MB

The first thing - these 2 numbers have nothing to do with each other!

One is dimensions in pixels, the other is file size in bytes.

It's just telling you that the photo is 1920x2560 in resolution size, and the
file is 3.59 mb in size... it is a compressed file as well...

JPEG stands for Japan or Joint (I forget!!) Photo Experts Group and they're the
guys who invented the special compression techniques used for photos.

Now, 1920 x 2560 = 4,915,200

See the discrepancy? This is the PIXEL count.

Now to make things more confusing, cameras make 32bit files, not 8bit, and a
byte is ALLWAYS 8 bits! However, computers use 24 bit files for pictures, 8 for
each of 3 colour's, so there is a lot of bit jiggling going on!

Some cameras use 10 bits instead of 8 for each color, but your computer will
adjust this to 8 bits so it fits into a byte.

Usually we use 24bit files, which is 3 x 8 bits, so your 1920 x 2560 = 4,915,200
x 3 = 14,745,600 bytes in total!

Most picture files are compressed, so there is NO WAY to tell how many bytes the
actual picture file will have.

>I open the file in PhotoShop and adjust levels, saturation and then sharpen
>it a bit. I then save it as a copy and select 'Quality 12 Maximum ' when
>prompted.

This is JPEG, right? You have a choice of compression amount.

>How is it that the file size is now 6.06 MB and where has the extra
>information come from ?

Re-sampling of data... this is a compressed file, all bets are off!

>Also, if I save the file as a TIFF, the file size increases to 14 MB !

This is the uncompressed version.

>I am confused....

We all are - don't give up!

>Steve

Reply to Bob

Archived from groups: rec.photo.digital (More info?)

 

Justin Thyme wrote:

Nice writeup! It deserves some nitpicking nonetheless:

> photoshop has no way of knowing exactly what was in the bits that
> were thrown away, but it makes a pretty good guess.

Decoding a jpeg does not involve any guesswork. The decoding algorithm
renders exactly what's in the jpeg, no less, no more. I don't think a
jpeg contains any information whether any given pixel is "true" or
"approximated" or entirely wrong, as in an artifact.

> The picture information it throws away
[when re-compressing the jpeg]
> could be the image data that photoshop created
> when it expanded the image out to full size...

more correct would be: "... could be the data that was created when the
image was compressed previously...".

--
Gregor's Motorradreisen:
http://hothaus.de/greg-tour/

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

"Biker2 \(Threadstopper\)" <steve at pvl dot co dot uk> writes:
> OK, so I open a JPEG which has come straight from my camera a
> Panasonic DMC-LC1

> I open the file in PhotoShop and adjust levels, saturation and then
> sharpen it a bit. I then save it as a copy and select 'Quality 12
> Maximum ' when prompted.
>
> How is it that the file size is now 6.06 MB

The file size when saving to JPEG depends on the "quality" setting
in Photoshop. You can lower this to get a file size similar to
the original file.

> and where has the extra information come from?

Photoshop does not know the difference between information
and noise. Shooting in JPG introduces noise in the form of
JPEG artefacts. At the 12 "quality" setting, Photoshop uses
extra bytes to faithfully preserves all the original
JPEG artefacts your camera creates when compressing the image.

Unfortunately, Photoshop will also add new JPEG artefacts when
you save in JPEG. The "quality" setting mainly controls what
new artefacts are created - at setting 12, there will be very
little /further/ degradation, at setting 1, there will be
extensive damage.

To make a long story short: Every time a file is re-saved in JPG
after editing, JPG-damage accumulates. If you edit your images, you
shouldn't shoot in JPEG, but in RAW. You should also use a non-lossy
format, such as TIFF or PSD (Photoshop's own format), for intermediate
saves. Only save to JPG for uses that require JPG (i.e. putting
images up on the web or sending to a consumer lab for printing).

> Also, if I save the file as a TIFF, the file size increases to
> 14 MB!

That is what it takes to save save /all/ RGB data from a 5 Mpx
camera at 8 bits/channel.

However, saving as TIFF makes little sense when you shoot in JPG,
because the data lost through JPG-compression is gone and can not be
restored. If you shoot in RAW, converting to TIFF for archival
storage is fairly standard procedure.

You may want to google for "raw" and "workflow" for more
information.
--
- gisle hannemyr [ gisle{at}hannemyr.no - http://folk.uio.no/gisle/ ]
------------------------------------------------------------------------
Kodak DCS460, Canon Powershot G5, Olympus 2020Z
------------------------------------------------------------------------

Reply to Anonymous

Archived from groups: rec.photo.digital (More info?)

 

"Biker2 \(Threadstopper\)" <steve at pvl dot co dot uk> writes:
> "Jim" <j.n@nospam.com> wrote:
>> "Biker2 (Threadstopper)" <steve at pvl dot co dot uk> wrote:

>>> OK, so I open a JPEG which has come straight from my camera a
>>> Panasonic DMC-LC1
>>>
>>> MS Explorer reports that the original file size is
>>> 1920 x 2560 = 3.59 MB

>> You math is a bit off. My calculator shows that 1920 x 2560 is
>> 4.91 Megapixels (not MB).

> I am using XP and in the bottom right hand corner of explorer it
> definately says 3.59 'MB'

Make sure yiu know the difference between /file size/ and
/pixel count/.

Your image's /file size/ is 3.59 Megabytes (MB).
But its /pixel count/ is 4.91 Megapixels (Mpx).

/File size/ is measure of much space you need to store a file on
your computer's hard disk. /Pixel count/ is a count of the number
of picture elements (= pixels) that makes up the image.

The file size of an /uncompressed/ image can be computed from
the pixel count if you know how many channels and how many
bits/channel is used. RGB images uses 3 channels and 8 or
16 bits/channel. Assuming 8 bits (= 1 byte) per channel,
we'll find that an image with a pixel count of 1920 by 2560
requires 1920 x 2560 (pixels) x 3 (channels) x 1 (byte) =
14 745 600 bytes or 14.7 Megabytes (Mb) of storage.

Now, the file size explorer reports is a lot less than that
(i.e. 3.59 Mb or 24 % of the original size), so as you can
see a JPG file is very compressed compared to the full size
image.

If you shoot RAW, you'll find that the RAW file is less than
14.7 Mb too. This is because the RAW file is compressed too.
But the compression of the RAW-file is different from the
compression of JPG. RAW-files uses lossless compression,
which means that can take have a smaller file size without
losing information.
--
- gisle hannemyr [ gisle{at}hannemyr.no - http://folk.uio.no/gisle/ ]
------------------------------------------------------------------------
Kodak DCS460, Canon Powershot G5, Olympus 2020Z
------------------------------------------------------------------------

Reply to Anonymous
Tom's Hardware > Forum > Digital Camera > Digital Camera General > File sizes, can anybody explain
Go to:

There are 532 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them