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.
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?
I started with an RGB image, scanned at 4000ppi, 14-bit, 5399 x 3690 pixels. Then saved from Photoshop as 16-bit PSD.
This may not be pertinent but I seem to remember that LZW-compression does not achieve proper compression on 16bit images at all.
- Saved as Tiff (Zip) = 96.5 MB
- 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.
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]
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.
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
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.
I've read through all the posts but still don't know why a PSD image is larger when it is called Background (120.1 MB) than when it is called Layer 0 (98.5 MB). See post 2. Also, Maximize Compatibility was turned off for my tests.
Aside from that, I'm trying to work out which file type to use in different circumstances. I'm just about to start scanning several thousand slides from multi-screen audiovisuals and then transfer the images and soundtrack to BluRay format. Each original slide-scan will occupy about 100 MB, and then I'll have second generation versions, all of which will be reduced to 8-bit with adjustment layers. I want to minimize overall storage space and archive time.
Given that I'll have a mixture of 16-bit and 8-bit images, some with layers, some without, is there a way to determine which of Tiff or PSD will generate minimum file size? It doesn't matter to me if I have a mixture of PSD and Tiff, I'm interested in knowing how to work out which file type to choose when saving a particular image. Example:
"Oh, this is an 8-bit image with 3 adjustment layers, that means I save as ..."
"This next one is 16-bit with only background, I'll save that as ..."
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
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.
North America
Europe, Middle East and Africa
Asia Pacific