Re:Fun Photoshop File Format Facts
by IvanK_net on Thursday March 03, 2016 @01:29PM
(#11218795)
Exactly. There is a flattened RGBA image at the end of a PSD file, which has dimensions corresponding to dimensions of a project.
Reading that flattened image from PSD takes 20 lines of code, while reading the structured content and producing final composition (blend modes, layer styles, masks, adjustment layers ...) takes at least 20 000 lines of code.
Row length encoding is used for storing channel data by default, so area with a constant color can be compressed much more efficiently, than area which has more "noisy" content.
Reading that flattened image from PSD takes 20 lines of code, while reading the structured content and producing final composition (blend modes, layer styles, masks, adjustment layers ...) takes at least 20 000 lines of code.
Row length encoding is used for storing channel data by default, so area with a constant color can be compressed much more efficiently, than area which has more "noisy" content.