PSD file size bug
Copy link to clipboard
Copied
There is serious issue with the PSD file size.
How to reproduce:
1. Create blank document 500x500x72 pixels with one white layer - save - PSD size 162kb
2. Insert 3840x2160 image and transform it down to fit 500x500 - save - PSD Size 10mb
(So problem n1, transformed 4k image to 500x500px should not be 10mb file size)
3. Delete the layer contains the 4k image - save - PSD Size 10mb
So even after the image is deleted and i have left only one white layer the file size is still big, this dosn't make any sense.
Explore related tutorials & articles
Copy link to clipboard
Copied
You may be overlooking metadata.
Please see
Inflated JPG File Size - Photoshop Document:Ancestors Metadata
2. Insert 3840x2160 image and transform it down to fit 500x500
Smart Object or not?
Copy link to clipboard
Copied
To test the metadata-suspicion:
If you save a jpg copy with »Save As« and another one with »Save for Web« (and no metadata) are the file sizes considerably different?
Copy link to clipboard
Copied
No smart Objects, just plain Free-transform with shift hold to contain proportions. But as i said i removed all images and layers except one white background layer and its still 10mb file size. Tried save as, different name, 10mb again. Export the file as for web the white image is 1.89kb png.
Copy link to clipboard
Copied
Sounds like Ancestor Metadata and not a bug.
Try running the Script from the thread I linked to in post 1 on the image and save it before placing it a new receiving document – does this save with an expected filesize?
Copy link to clipboard
Copied
HI,
The script seems to do the job and reduced 10mb to 43kb, but why do i need to do that? seems bug to me, idk what Ancestor Metadata is
Copy link to clipboard
Copied
Not everything that is annoying is a bug …
In any case the problem seems to be caused to the file you placed, not so much by Photoshop itself.
Ancestor metadata can accumulate and can be transferred even in pasting copied content in Photoshop.
If you want to know what it looks likes open the original file and check out
File > File Info > Raw Data
Copy link to clipboard
Copied
The image you are copying and pasting into the PSD is inflated with Metadata.
I encounter this problem all the time. If I choose Save As... to a .jpg file within Photoshop of a flattened rastered image the file size can be over several MB. If I choose Export > Save for Web (Legacy) then the file size is extremely small because the saving for web excludes all the Metadata during the save process.
The problem is not your PSD file, but the image you are bringing into it. You can try resaving the image you are copying as a Save for Web, then open the new save and copy and paste and it should be back to normal file size for the PSD... or you can run a script to clear the metadata.
If you bring a file with inflated Metadata to a PSD file via copy-paste, the PSD then inherits that metadata, regardless if you delete the original pasted content/image.
Copy link to clipboard
Copied
This does make sense, so i just made another experiment.
1. Save for Web an 1249x1249 image - no inflated Metadata on the image, total size 315kb JPEG
2. Created new empty 500x335 PSD, and added the image. Result 2.5mb PSD.
Its not Metadata inflated, where does this 2mb extra comes from? Does PS somehow uncompressed the image?
Copy link to clipboard
Copied
I just did a recreate. Created a very heavy graphic image of 1249x1249 RGB at 100dpi and Saved as Web - file size of that graphic was 1MB.
I created a 500x335 PSD file no layers but default bg layer = 31k.
I then pasted the 1249x1249 graphic saved, then resized the pasted graphic smaller to fit within 500x335 and saved.
PSD file size without resized pasted graphic = 4.9MB
PSD file size when I resized pasted graphic making it fit much smaller 500 pixel width = 1.2MB
see screenshots
Copy link to clipboard
Copied
It shows the metadata (like camera, date, copyright) of all the files used to make this one, even if they left no current trace. Doesn’t usually amount to much but some people never start with new documents; in their work they always open an existing file, delete and replace old stuff. If you‘ve used the same basic file and added thousands of photos in turn, you end up with a very big file.
Your test sounds as as if you started with a brand new file, but was it?
Copy link to clipboard
Copied
One of the files wasn't a new file and i decided that is corrupt, that's why i made a completely new file, but for me there is no logic an PSD with one white layer to be 43kb and adding 1mb of JPEG to make the PSD 2.5mb, where is the extra 1.5mb coming from? (and i hide the layers on save to avid preview file size increase).
Copy link to clipboard
Copied
I guess to answer that you’d need an expert to look over the ancestor metadata with you.
Copy link to clipboard
Copied
Just made another test,
1. Create brand new 500x335x72 with one white layer PSD - 43kb
2. Added 1.06mb 1249x1249px png image - hide all layers, - save - 2.39mb
3. In File info - raw data i have only around 20 lines so its not metadata.
Copy link to clipboard
Copied
If you hide all layers the layer are still saved with their visibility set off all the layer data is still saved. Hiding all layer will just make the saved full composite all white and and compress better than image data. An image layer 1249x1249 8bit RGB is 4,680,003 bytes uncompressed.
Copy link to clipboard
Copied
I do not understand what do you mean by "An image layer 1249x1249 8bit RGB is 4,680,003 bytes uncompressed."?
Are you saying that an white image 1249x1249 8bit RGB is 4.7mb?
Copy link to clipboard
Copied
It is simple math an image 1249 px x 1249 px is an image that has 1,560,001pixels in 8bit RGB color each pixel has an 8bit value of data for red, 8bits for green and 8bits for blue so each pixel has 3Btyes of data. 3x1,560,001= 4,680,003 bytes of data in memory. When save into a file most image file data formats support data compression so the image data will be compress and will save at a size less than 4,680,003bytes. In memory an image layer 1249x1249 pixels in 8bit color requires 4,680,003bytes
A 4k Display 8bit image is 24,883,200MB
Copy link to clipboard
Copied
I don't know why are you explaining this and i don't see the relation to the issue.
1249x1249 8bit RBG white color PNG 100% is 8.51KB way far from 4.7MB.
So are you saying that this 8.51kb PNG will somehow produce 4.7MB PSD?
Please skip theory craft, and just explain if you can, simply, how an 1.06mb file produces 2.5mb PSD.
Copy link to clipboard
Copied
Different image file formats store image data differently. Most use data compression. So the size on disk depends on how well the image data compresses. Images with little detail compress well and small an image with lots of detail will not compress well. So same size image save at many different file sizes. Here I did your 500px x 500px white image I duplicated the document and added noise. I saved both 500px by 500 px single layer documents as psd files. The one with noise add saved 21time larger than the white one.
Open in Photoshop both image are 500x500px and require 750,000 bytes 500x500x3
Copy link to clipboard
Copied
Interesting discussion.
Note - the latest version of Photroshop v 20.0.2 should, according to the release notes, address the excess metadata issue directly.
Fixed issues in Adobe Photoshop CC
The size of PSD also depends on the options in Preferences > File Handling i.e. whether or not "Disable Compression of PSD and PSB files" is checked and whether "Maximise PSD and PSB File Compatibity" is set to "always" . The latter saves a flattened copy in the file alongside the image and adjustment layers.
Dave
Copy link to clipboard
Copied
Thanks for the heads up Dave!
I added this footnote to my blogpost:
Copy link to clipboard
Copied
Also note that is 750,000 bytes decimal 750,000/1024= 732K hex Note: the size Photoshop shows in the image window frames for both images.
Copy link to clipboard
Copied
Using Copy/Paste toe insety the 4K layers the free transform to size the to fit within the 500px by 500PX canvas the size og the saved PSD fine in your second step was 1.2 MB on my system not 10MB like yours. How did you incert the 4K layers? When I remover the image layers it saved as a 34KB psd
Copy link to clipboard
Copied
The 10mb file was 10mb from Ancestor metadata as c.pfaffenbichler descried and his script fixed the file.
However, this still don't explain how adding 1.06mb image to a brand new document produces 2.4mb with hidden layers PSD, its not
Ancestor metadata as i run the script and its a brand new file. Where are the 100% more file size coming from is a complete misery to me.
Copy link to clipboard
Copied
For what it's worth, a PSD image file CAN be larger than the in memory size, never mind larger than the PNG.
This is because PSD files saved in the oldest, most compatible, file format will use run length compression, which will get bigger, not smaller, for repeated horizontal gradients among other patterns. Consider too that you store each layer AND the flattened image too, so you could be looking at multiples of the memory size. Later, less compatible, PSD files will use ZIP compression, like PNG, but still have all layers + composite as an overhead.
I don't think that's the issue. It's a response to "are you saying that this 8.51kb PNG will somehow produce 4.7MB PSD?"


-
- 1
- 2