File sizes, can anybody explain

Discussion in 'Digital Cameras' started by Biker2 \(Threadstopper\), Sep 6, 2005.

  1. 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
    --
     
    Biker2 \(Threadstopper\), Sep 6, 2005
    #1
    1. Advertisements

  2. Biker2 \(Threadstopper\)

    Justin Thyme Guest

    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.
     
    Justin Thyme, Sep 6, 2005
    #2
    1. Advertisements

  3. 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)
    --
     
    Biker2 \(Threadstopper\), Sep 6, 2005
    #3
  4. Biker2 \(Threadstopper\)

    Bill DeWitt Guest

    Biker2 (Threadstopper) mentioned in passing :
    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.
     
    Bill DeWitt, Sep 6, 2005
    #4
  5. Biker2 \(Threadstopper\)

    Bill DeWitt Guest

    Thomas T. Veldhouse mentioned in passing :
    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"...
     
    Bill DeWitt, Sep 6, 2005
    #5
  6. Biker2 \(Threadstopper\)

    ASAAR Guest

    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.
     
    ASAAR, Sep 6, 2005
    #6
  7. Biker2 \(Threadstopper\)

    Bill Funk Guest

    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, Sep 6, 2005
    #7
  8. Biker2 \(Threadstopper\)

    Greg N. Guest

    Justin Thyme wrote:

    Nice writeup! It deserves some nitpicking nonetheless:
    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.
    more correct would be: "... could be the data that was created when the
    image was compressed previously...".
     
    Greg N., Sep 8, 2005
    #8
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.