Hacker News new | ask | show | jobs
by oseph 1961 days ago
Here's a "cool" PSD quirk.

Take a PSD that has many layers. Look at its filesize (mine is ~70mb). Add one layer to the PSD, fill it with white, and make it the topmost layer. Save it as a new PSD and compare the filesizes.

The new PSD with the white layer is 55mb. Why?

1 comments

Most* PSD files contain a "preview" copy of the fully-flattened document (which is compressed.) Flat white image compresses far better, so that portion of the file doesn't take as much space.

Depending on what your layers look like (how many, how much they cover, etc.) it's not too surprising that the preview image could take a substantial fraction of the total file size (sounds like ~20% in this case!)

* I believe this behavior can be toggled off with an option.

Interesting. I want to believe this is the case, but I feel like it is still a bug/quirk.

In Photoshop's preferences there is an option under File Handling to disable image previews, and toggling this seems to have no effect on what I described above. Strange!

Is the preview the full resolution? That seems very overkill.
Perhaps, but it's quite convenient for any software that wants to ingest PSD files without the (nigh-intractable) challenge of reimplementing the entirety of Photoshop's parser and rendering systems!
The "preview" is actually the main image data from the version of the file format that was used before Photoshop supported layers.

It remains there, I guess, so that you can display the image even if you don't support loading and compositing layers.