You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all layers are rendered in full size of the window, which makes the resulting psd unnecessarily big. The file is automatically trimmed by photoshop, but only after the user opens and resaves the file. We need to find a way to trim the whitespace out to make the PSD smaller and easier to transport via Email.
One way of doing it would be to:
Inspect the generated layer images and scan line by line. This has the advantage of detecting empty layers (i.e. layers with only transparent pixels), but will require image analysis on each layer.
A more elegant and efficient method would be to calculate the required layer bounds by recursing through the child layers and 'unioning' the layer rects. This however won't detect empty (transparent) layers
A combination of both might be the best approach.
The text was updated successfully, but these errors were encountered:
Hi, did just make a PR on this.
My first optimization is on layer content. Layer are no longer rendered from there parent, but directly on them, and I did compute offset from parent layer
Generated PSD files size is divided by 3 to 4 with my tests.
Next step is to crop generated document size in
Currently all layers are rendered in full size of the window, which makes the resulting psd unnecessarily big. The file is automatically trimmed by photoshop, but only after the user opens and resaves the file. We need to find a way to trim the whitespace out to make the PSD smaller and easier to transport via Email.
One way of doing it would be to:
A combination of both might be the best approach.
The text was updated successfully, but these errors were encountered: