Skip navigation
Currently Being Moderated

Layered PSD file smaller than unlayered file

Jun 22, 2012 10:40 PM

I have been doing some tests to minimize file size. I thought it strange that a layered RGB 16-bit PSD file (one Curves layer) is smaller than the same file when flattened. Is that normal? Should that be the case?

 

I'm running CS6 on an Intel iMac under OSX 10.6.8.

 
Replies
  • Currently Being Moderated
    Jun 22, 2012 10:49 PM   in reply to Guy Burns

    I can imagine that happening when the flattening of the file causes the curve to transform the pixels in a way that they can't be compressed as efficiently as the layered file.  Remember that all PSD files have non-lossy compression.

     

    What differences are we talking about here, specifically?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 23, 2012 3:04 AM   in reply to Guy Burns

    This may not be pertinent but I seem to remember that LZW-compression does not achieve proper compression on 16bit images at all.

     

    1. Saved as Tiff (Zip) = 96.5 MB
    2. Renamed background to Layer 0 = 192.4 MB (Tiff)

    That might be because the tiff contains the layer and a flattened preview, effectively doubling the image.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 23, 2012 9:29 AM   in reply to Guy Burns

    There does seem to be something strange about CS6 (and CS5) PSD file size. The first non-Background pixel layer consumes twice as many bytes as any other pixel layer containing that image.

     

    Examples (sizes rounded) where each layer contains identical image:

     

    Background: 100 MB

    Background + 1 pixel layer + composite of 2 layers: 300 MB

    Background + 2 pixel layers + composite of 3 layers: 400 MB

    Background + 3 pixel layers + composite of 4 layers: 500 MB

    1 pixel layer + composite of that layer : 200 MB

    2 pixel layers + composite of 2 layers: 300 MB

    3 pixel layers + composite of 3 layers: 400 MB

     

    [admin corrected your math]

     
    |
    Mark as:
  • Noel Carboni
    20,943 posts
    Dec 23, 2006
    Currently Being Moderated
    Jun 23, 2012 8:51 AM   in reply to conroy

    There are different constraints for compression for the flattened compatibility image vs. the actual saved layers.

     

    -Noel

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 23, 2012 9:44 AM   in reply to Noel Carboni

    Hi Noel,

     

    Am I correct to think that if the doc contains only a Background layer then that functions as a compatibility image, otherwise the file will contain an additional (hidden to the user) compatibility image which is created by flattening the entire document?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 23, 2012 10:00 AM   in reply to conroy

    Examples (sizes rounded) where each layer contains identical image:

     

    Background: 100 MB

    Background + 1 pixel layer + composite of 2 layers: 300 MB

    Background + 2 pixel layers + composite of 3 layers: 400 MB

    Background + 3 pixel layers + composite of 4 layers: 500 MB

    1 pixel layer + composite of that layer : 200 MB

    2 pixel layers + composite of 2 layers: 300 MB

    3 pixel layers + composite of 3 layers: 400 MB

     

    [admin corrected your math]

     

    Hmmm... I disagree that anything should have been "corrected". For each example, I wrote the number of separate layers as evident in Photoshop to the user (me) who didn't do any compositing.

     

    Background: 100 MB

    Background + 1 pixel layer: 300 MB

    Background + 2 pixel layers: 400 MB

    Background + 3 pixel layers: 500 MB

    1 pixel layer: 200 MB

    2 pixel layers: 300 MB

    3 pixel layers: 400 MB

     

    The information could have been provided in a reply to explain what Ps is writing into the file when the user is dealing with the situations of my examples.

     
    |
    Mark as:
  • Noel Carboni
    20,943 posts
    Dec 23, 2006
    Currently Being Moderated
    Jun 23, 2012 10:23 AM   in reply to conroy

    conroy2009 wrote:

     


    Am I correct to think that if the doc contains only a Background layer then that functions as a compatibility image, otherwise the file will contain an additional (hidden to the user) compatibility image which is created by flattening the entire document?

     

    I believe that is true, yes, but my information is all from observation (I haven't a close working knowledge of the PSD format).  I hope that someone more knowledgeable will correct me if I'm wrong.

     

    I had a conversation here a few years ago about file sizes (and speed of compression) with Chris Cox, then again more recently, and to the best of my recollection he said that the compression can be more aggressive with the non-composite layers than the compatibility image.

     

    You probably already know about it, but keep in mind that there's a "Maximize PSD and PSB Compatibility" setting in the Preferences that affects whether that hidden composite is created.

     

    -Noel

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 23, 2012 10:35 AM   in reply to conroy

    When you saved the file, it has the flattened (composite) image, plus your layer data.

     

    The corrected version is accurate, while your original math failed to take the composite data into account.

    Once you account for the composite image, the numbers make sense.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 23, 2012 11:13 AM   in reply to Chris Cox

    Yes, the correction contains accurate math. The math was not my complaint.

     

    Of course, my math didn't take the composite into account. I didn't know about the composite when originally posting. If I did know then I would not have said something strange seemed to be happening with the file size. You have given the explanation. Thank you!

     

    My disagreement was with the choice to edit my original post instead of simply responding to it. The edit makes my opening remark regarding something strange, when combined with the edits, appear to be nonsense.

     

    Again, thanks for explaining why the file sizes are as they are.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 23, 2012 11:25 AM   in reply to Noel Carboni

    Thanks, Noel. Chris has confirmed that there is a composite (compatibility image) embedded in the file which accounts for the extra 100 MB in my examples which contain more than just a Background layer.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 2:34 AM   in reply to conroy

    Nobody reads post 3?

    Edit: I guess my terminology was off …

     
    |
    Mark as:
  • Noel Carboni
    20,943 posts
    Dec 23, 2006
    Currently Being Moderated
    Jun 24, 2012 6:15 AM   in reply to Guy Burns

    Guy, I think Christoph touched on it and my answers in posts 5 and 8 helped further cover the issue.

     

    Compression is done by different methods for the flattened composite and for layers, and as conroy pointed out in post 6 the Background becomes the flattened composite in some cases.  I'm guessing you have Maximize Compatibility turned off.

     

    As advice:  I save all masters as PSDs and not worry about small size differences.  Hard drive space - even SSD - is pretty cheap nowadays.

     

    -Noel

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 7:03 AM   in reply to Noel Carboni

    I suspect that the mystery increase is caused by an 8-bit compatibility image being embedded in the 16-bit Background-only PSD.

     

    This table shows what I think may be happening:

     

    16b-table.png

     

    Edit: ignore the red dots - that was a spellchecker that I should have disabled.

    .

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 12:06 PM   in reply to conroy

    In a 16 bit image, all the data is 16 bit.  The only thing that would be 8 bit is the tiny JPEG thumbnail.

    (ditto for 32 bit)

     

    In a background only image - the background is the composite, so no data is duplicated.

    As soon as you have a layer, you have to save the layer plus a separate composite.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 12:40 PM   in reply to Chris Cox

    As soon as you have a layer, you have to save the layer plus a separate composite.

     

    Thanks, Chris. I thought a composite was only added in "max compatibility" PSD.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 1:36 PM   in reply to conroy

    There is a composite of some sort in the file, even if max compat is turned off. But if max compat is turned off then the composite is solid black (used to have a "saved without max compat" message in it).

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points