Closed janwool closed 5 months ago
Yes, but it might be complicated and it might not work the way that's useful to you.
In general if you want to create some specific file structure it's best if you create it using Photoshop or https://www.photopea.com/ and import it using ag-psd to see how the structure that you want looks like. You can see example structure here: https://github.com/Agamnentzar/ag-psd/blob/master/test/read/smart-object-png/data.json
The problem with smart objects is that PSD file contains pre-rendered smart object layer instead of rendering it when opening the file, so you'd need to render the layer bitmap yourself to include it into the PSD file. You'd also have to draw the composite image of all layers yourself too (if you need it, composite image is not needed for the file to be readable by Photoshop)
You can see more explanation here: https://github.com/Agamnentzar/ag-psd#modifying-documents
Maybe this helps: https://github.com/Agamnentzar/ag-psd/issues/147
Can I create smart object by ag-psd library?